//* image rollover *//
function overRoll( obj ) {
    obj.src = obj.src.replace( 'off.gif', 'on.gif' );
}
function outRoll( obj ) {
    obj.src = obj.src.replace( 'on.gif', 'off.gif' );
}

//<![CDATA[
	function chgHeadingTab(el) {
		if (!document.getElementsByTagName) return false;
		var tabtag = el;
		var headings = new RegExp("[h1-6]","i");
		while (!headings.test(tabtag.tagName)) {
			tabtag = tabtag.parentNode;
		}
		if (!headings.test(tabtag.tagName)) return false;
		var tabparent = tabtag.parentNode;
		tabtag = tabtag.tagName;
		var clickedtab = el;
		while (clickedtab.tagName != tabtag) {
			clickedtab = clickedtab.parentNode;
		}
		var tabitems = tabparent.getElementsByTagName(tabtag);
		for (var i=0; i<tabitems.length; i++) {
			var tabimg = tabitems[i].getElementsByTagName("IMG")[0];
			var tabcont = tabitems[i].nextSibling;
			while (tabcont.nodeType != 1) {
				tabcont = tabcont.nextSibling;
			}
			if (tabitems[i] == clickedtab) {
				tabimg.src = tabimg.src.replace("_off.gif","_on.gif");
				tabcont.style.display = "block";
			} else if (tabitems[i] != clickedtab) {
				if (tabimg.src.indexOf("_on.gif") != -1) {
					tabimg.src = tabimg.src.replace("_on.gif","_off.gif");
				}
				tabcont.style.display = "none";
			}
		}
		return false;
	}
	function chkContOn(el) {
		var tab = el;
		var headings = new RegExp("[h1-6]","i");
		while (!headings.test(tab.tagName)) {
			tab = tab.parentNode;
		}
		if (!headings.test(tab.tagName)) return false;
		var tabcont = tab.nextSibling;
		while (tabcont.nodeType != 1) {
			tabcont = tabcont.nextSibling;
		}
		return tabcont.style.display != "none" ? true : false;
	}
//]]>


// getFlash

function SWFLoader() {
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	
	var classId = new String;
    var codeBase = new String;
	var pluginSpage = new String;
	var embedType = new String;	
	var allParameter = new String;	
	
	var src = new String;
	var width = new String;
	var height = new String;
	var id = new String;
	var layer = new String;
	var arg = new String;
	var altText = new String;
	var wmode = new String;

	this.init = function ( w, h, s, a ) {
		width = w; //³ÐÀÌ
		height = h; //³ôÀÌ
		src = s; //ÆÄÀÏ°æ·Î
		arg = String(a).replace(/\&/gi, '%26'); // ¸Å°³º¯¼ö

		wmode = 'transparent'; //¸ðµå¼³Á¤

		classId = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
		codeBase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
		pluginSpage = 'http://www.macromedia.com/go/getflashplayer';
		embedType = 'application/x-shockwave-flash';

		parameter += "<param name='allowScriptAccess' value='always'>\n";
		parameter += "<param name='allowFullScreen' value='false'\n>";
		parameter += "<param name='movie' value='"+ s + "'>\n";
		parameter += "<param name='quality' value='high'>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name=FlashVars value='arg="+arg+"'>\n";
	}
	
	//ÇÃ·¡½Ã ¿ÀºêÁ§Æ® ¿É¼Ç¼³Á¤
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	// ÇÃ·¡½Ã wmode ¼³Á¤ setFlash.wmode('window')
	this.wmode = function ( value ) {
		wmode = value;
	}

	// ÇÃ·¡½Ã ¾ÆÀÌµð ¼³Á¤
	this.id = function ( value ) {
		id = value;
	}
	
	// ÇÃ·¡½Ã ´ëÃ¼ÅØ½ºÆ® ¼³Á¤
	this.alt = function ( value ) {
		altText = value;
	}

	// ÇÃ·¡½Ã »ðÀÔ ·¹ÀÌ¾î ¼³Á¤
	this.layer = function ( value ) {
		if(value == undefined) {
			layer = "";
		} else {
			layer = value;
		}
	}

	this.show = function () {
		obj = '<object id="'+id+'" width="'+width+'" height="'+height+'" classid="'+classId+'" codebase="'+codeBase+'">\n'+
			parameter +
			'<param name="wmode" value="'+wmode+'">\n'+
			'<!--[if !IE]>-->\n' +
			'<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '" name="' + id + '">\n' +
				parameter +
				'<param name="wmode" value="'+wmode+'">\n'+
			'<!--<![endif]-->\n' +
				'<div class="alt-content alt-' + id + '">' + altText + '</div>\n' +
			'<!--[if !IE]>-->\n' +
			'</object>\n' +
			'<!--<![endif]-->\n' +
		'</object>';

		if(layer == "") {
			document.write(obj);
		}else{
			var div = document.getElementById( layer);
			div.style.display = "";
			div.innerHTML = obj;
		}
	}
}



function hideSWFLayer( div) {
	var div = document.getElementById( div);
	div.style.display = "";
	div.innerHTML = "";
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	}
	else {
		return document[movieName];
	}
 }

 function callExternalInterface(movieId, id) {
    if(id=="play" || id=="stop"){
    	var imgSrc =document.getElementById("playBtn").src;
    	if(id=="play"){
    		if(imgSrc.indexOf("pause")!=-1){
        	    thisMovie(movieId).controlFunc( "pause" );	
        		document.getElementById("playBtn").src = "/image/img/btn_play.gif";
    		}else{
	    	    thisMovie(movieId).controlFunc( "play" );	
	    		document.getElementById("playBtn").src = "/image/img/btn_pause.gif";
    		}
    		//document.getElementById("stopBtn").src = "";
    	}else{
    	    thisMovie(movieId).controlFunc( id );	
    		document.getElementById("playBtn").src = "/image/img/btn_play.gif";
    		//document.getElementById("stopBtn").src = "";
    	}
    }else{
	    thisMovie(movieId).controlFunc( 'stop' );	
	    thisMovie(movieId).controlFunc( id );	
	    thisMovie(movieId).controlFunc( 'play' );	
		document.getElementById("playBtn").src = "/image/img/btn_pause.gif";
	    for(i=1 ; i<=5 ; i++){
	    	if(i==id){
	    		document.getElementById("movieImg"+i).src = document.getElementById("movieImg"+i).src.replace("off","on");
	    	}else{
	    		document.getElementById("movieImg"+i).src = document.getElementById("movieImg"+i).src.replace("on","off");
	    	}
	    }
    }
}

function resizeSWF( id, height){
	document.getElementById( id ).height = height;
}
//------------------- SWF °øÅë Á¦¾îÇÔ¼ö ³¡




function getCookie(name){
  var cname = name + "=";
  var dc = document.cookie;
  if (dc.length > 0) {
    begin = dc.indexOf(cname);
    if (begin != -1) {
      begin += cname.length;
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    }
  }
  return null;
}

function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) +
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
  document.location.reload();
}

var firstCall = true;

function changeFontsize(fSize, increment) {
	if (firstCall) {
		firstCall = false;
		if (increment != "") {
			changeFontsize('12', '');
		}
	}
	if (document.getElementsByTagName) {
	var getElement = document.getElementsByTagName("*");
	var eachElement, currentFontSize, fontIncrease, newFontSize;
	for (i=0; i<getElement.length; i++) {
		eachElement = getElement[i];
		if (increment != "") {
			currentFontSize = parseInt(eachElement.style.fontSize);
			fontIncrease = parseInt(increment);
			newFontSize = currentFontSize + fontIncrease;
		}
		else if (fSize != "") {
			newFontSize = parseInt(fSize);
		}
		if (getElement[i].tagName == "LI") {
			eachElement.style.lineHeight = Math.round(newFontSize*1.2) + "px";
		} else {
			eachElement.style.lineHeight = Math.round(newFontSize*1.5) + "px";
		}
		if (fSize != "") {
			switch(getElement[i].tagName) {
				case "H2": newFontSize += 3; break;
				case "H3": newFontSize += 2; break;
				case "H4": newFontSize += 1; break;
				case "H5": newFontSize += 1; break;
				case "H6": newFontSize += 1;
			}
		}
		eachElement.style.fontSize = newFontSize + "px";
		setCookie('fontSize', newFontSize);
	}
}
}

// quick
/*function getPosition(){
	var start, end, scale, term;
	start = parseInt (document.getElementById('quickMenu').style.top, 0);
	if(document.documentElement.scrollTop>80)
		end = document.documentElement.scrollTop-100 + 0;
	else
		end = document.documentElement.scrollTop + 0;
	term = 5;
	if ( start != end ) {
	scale = Math.ceil( Math.abs( end - start ) / 20 );
		if ( end < start )	scale = - scale;
		document.getElementById('quickMenu').style.top = parseInt (document.getElementById('quickMenu').style.top, 0)+ scale + "px";
		term = 1;
	}
	setTimeout ("getPosition()", term);
}



function moveBanner() {
	document.getElementById('quickMenu').style.top = document.documentElement.scrollTop + 0 + "px"; 
	getPosition();
	return true;
}*/

function flashrollingLogoLink(e) {
	if(e == 0) window.open('http://blog.daum.net/mocie');void(0);	
	if(e == 1) window.open('http://blog.naver.com/mocienews');void(0);	
	if(e == 2) window.open('http://lib.mke.go.kr/')	
	if(e == 3) window.open('https://pms.mocie.go.kr:8443/index.jsp');void(0);	
	if(e == 4) window.open('http://blog.korea.kr/main/blog.do?blogId=40000072');	
}

function flashIndustryLink(e) {
	if(e == 1) location.href = "javascript:setFlexMenuCode('realEconomy','main');";			
	else if(e == 2) location.href = "javascript:setFlexMenuCode('policyTrade','main');";	
	else if(e == 3) location.href = "javascript:setFlexMenuCode('policyEnergy','main');";	
}

function flashbuttomRollingLink(e) {
	if(e == 1) {window.open('http://www.istans.or.kr/');void(0);}	
	else if(e == 2) {window.open('http://www.hikorea.go.kr/pt/index.html');void(0);}	
	else if(e == 3) {window.open('http://www.g4b.go.kr/');void(0);}	
	else if(e == 4) {window.open('http://www.yestrade.go.kr/');void(0);}	// yes trade
	else if(e == 5) {window.open('http://www.comis.go.kr/index.html');void(0);}	// comis
	else if(e == 6) {window.open('http://www.standard.go.kr/');void(0);}	
//	else if(e == 7) {window.open('http://www.ibkjob.co.kr');void(0);}	
    else if(e == 7) {window.open('http://www.korea.net/');void(0);}	// KOREA.net
	else if(e == 8) {window.open('http://www.n-cer.com/index.do');void(0);}	// N-CER
	else if(e == 9) {window.open('http://cyber.kepco.co.kr/jungso/');void(0);}	
//	else if(e == 9) {window.open('http://english.mosf.go.kr/zattach/_pr/mosf20081117policy.pps');void(0);}	
	else if(e == 10) {window.open('http://www.bizinfo.go.kr/');void(0);}	// SPi
	else if(e == 11) {window.open('http://www.itis.or.kr/');void(0);}	// ITIS
	else if(e == 12) {window.open('http://mkeunion.or.kr/');void(0);}	
//  else if(e == 13) {window.open('http://www.Oklife.go.kr');void(0);}	
//  else if(e == 13) {window.open('http://www.epost.go.kr');void(0);}	
	else if(e == 13) {window.open('http://www.mopas.go.kr/gpms/ns/mogaha/user/userlayout/userinsareqin/userinsaSelect.action');void(0);}	// ÀÎ»ç½Å¹®°í
	else if(e == 14) {window.open('http://www.epeople.go.kr');void(0);}	
	else if(e == 15) {window.open('http://www.korea.go.kr/');void(0);}	
//  else if(e == 16) {window.open('http://www.visionkorea60.go.kr/');void(0);}	
	else if(e == 16) {window.open('http://www.knowtbt.kr/');void(0);}	// knowTBT 
	else if(e == 17) {window.open('http://www.index.go.kr/egams/default.jsp');void(0);}	
	else if(e == 18) {window.open('http://www.korea.kr/newsWeb/appmanager/portal/news2');void(0);}	
}

function flashMainPopup(e) {
	if(e == 1) location.href = '#';
	if(e == 2) location.href = '#';
	if(e == 3) location.href = '#';
	if(e == 4) location.href = '#';
	if(e == 5) location.href = '#';
}


function viewSWFLayer( _id, _wd, _ht, _dir, _xmlurl) {
	var w = document.body.scrollWidth;
	var h = document.body.scrollHeight;
	var div = document.getElementById("siteMap");
	div.style.width = w;
	div.style.height =h;

	var id = _id;
	var width = _wd;
	var height = _ht;
	var dir = _dir;
	var xmlurl = _xmlurl;
	var html;

	html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+width+"' height='"+height+"'>";
	html += "<param name='allowScriptAccess' value='always'>";
	html += "<param name='allowFullScreen' value='false'>";
	html += "<param name='movie' value='"+dir+"'>";
	html += "<param name='quality' value='high'>";
	html += "<param name='wmode' value='transparent'>";
	html += "<param name='base' value='.'>";
	html += "<param name=FlashVars value='arg="+xmlurl+"'/>";
	html += "<embed base='.' src='"+dir+"' FlashVars='arg="+xmlurl+"' quality='high' width='"+width+"' height='"+height+"' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' wmode ='transparent' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>";
	html += "</object>";

	var layername = document.getElementById( id);
	layername.style.display = "";
	layername.innerHTML = html;
	
}

//function hideSWFLayer( _id) {
//	var id = _id;
//	var layername = document.getElementById( id);
//	var hidetarget = document.getElementById('top-sitemap');
//	layername.style.display = "none";
//	layername.innerHTML = "";
//	hidetarget.className = ''
//}

function controlLayer(e) {
	var div = document.getElementById("contentswv");
	if(e == "Off") {
		div.className = "contentswv2"
	}
	else {
		div.className = "contentswv"
	}
}

// top sitemap layer (height - 0/100%)
function sitmapLayer() {	
	var target = document.getElementById('top-sitemap');
	target.className = (target.className=='' ? 'top-sitemap-open':'');
}

// main select layer
function srchLayer() { document.getElementById('srchLayerList').className = 'selectlayer-box-open'; }
function srchLayerHide() { document.getElementById('srchLayerList').className = 'selectlayer-box'; }

// familysite
function famlistAction() {	
	var target = document.getElementById('familyList');
	target.style.display = (target.style.display=='block' ? 'none':'block');
}

// popup
function popup(Fn,Win, X, Y, Scroll){
l = (screen.width) ?	(screen.width- X) / 2	: 0;
t = (screen.height) ?	(screen.height- Y) / 2 : 0;	
	NewWindow=window.open(Fn,Win,'width='+X+',height='+Y+',top='+t+',left='+l+',scrollbars='+Scroll+',toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no');
}

// viewer download
document.writeln("<form name='down' method='get' action='/common/kep_download.jsp'>");//=>
document.writeln("<input type='hidden' name='FileName3'>");
document.writeln("<input type='hidden' name='FileName2' >");
document.writeln("<input type='hidden' name='FileName1' >");

document.writeln("</form>");
function getDown(sFile1,sFile2) {	
	down.FileName1.value=sFile1;
	down.FileName2.value=sFile2;
	down.submit();
}

function listgo(e) {   
opener.top.location= e;    
self.close();   
}    

//function flashTopLogin(e) {
//	thisMovie("topNavi").flashTopLogin(e)
//}

function Printing() {
	var txts = "/common/jsp/print.jsp";
	window.open(txts,'print','width=658,height=600,scrollbars=yes');void(0);
}

function PrintingDic() {
	var txts = "/common/jsp/printDic.jsp";
	window.open(txts,'print','width=658,height=600,scrollbars=yes');void(0);
}

function PrintingToday(value,date) {
	var txts = "/common/jsp/printToday.jsp?pageMode="+value+"&txtDate="+date;
	window.open(txts,'print','width=658,height=300,scrollbars=yes');void(0);
}

function printFlex() {
	setTimeout(window.print(),3000);
}

function call_wnsearch(){
	forms = document.wnsearch;
	code = forms.cate.value;

	if(code=="0")
		forms.action = "/common/search/wnsearch.jsp";
	else if(code=="1")
		forms.action = "/common/search/dicsearch.jsp";
	else
		forms.action = "/common/search/orgsearch.jsp";
	forms.submit();
}

function changeAction(object) {
	var ret = object.value;

	if(ret == 0) {
		document.wnsearch.action = "/common/search/wnsearch.jsp";
		document.wnsearch.collection.value = "all";
	} else if(ret == 1) {
		document.wnsearch.action = "/common/search/dicsearch.jsp";
		document.wnsearch.collection.value = "dic";
	} else if(ret == 2) {
		document.wnsearch.action = "/common/search/orgsearch.jsp";
		document.wnsearch.collection.value = "org";
	} else {
		document.wnsearch.action = "/common/search/wnsearch.jsp";
		document.wnsearch.collection.value = "all";
	}
	/*else if(ret == 3) {
		wnsearch.action = "/common/search/search_action.jsp";
		wnsearch.collection.value = "db";
	}*/
}

/*function checkEntersearch() {
	if(event.keyCode == 13) checkEntersearchAction();
}*/

function checkEntersearch(e){
	if(window.event){ // IE
        keynum = e.keyCode;
    }else if(e.which){ // Netscape/Firefox/Opera
        keynum = e.which;
    }
    if(keynum==13){checkEntersearchAction();}
}

function checkEntersearchAction() {	
	var skwd = document.wnsearch.query.value;
	var obj = document.wnsearch.cate;
	changeAction(obj);

	if (skwd==""){
		alert("°Ë»ö¾î¸¦ ³Ö¾îÁÖ¼¼¿ä");
		document.wnsearch.query.focus();
		return;
	} 

	//alert(skwd.length);
	if (skwd.length<2){
		alert("°Ë»ö¾î¸¦ 2ÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		document.wnsearch.query.focus();
		return;
	} else if ( skwd!="" )	{
		document.wnsearch.submit();
	}
}



function checkEntersearchActionSub() {	
	var skwd = document.wnsearch.query.value;
	var obj = document.wnsearch.cate;
	changeAction(obj);

	if (skwd==""){
		alert("°Ë»ö¾î¸¦ ³Ö¾îÁÖ¼¼¿ä");
		document.wnsearch.query.focus();
		return;
	} 

	//alert(skwd.length);
	if (skwd.length<2){
		alert("°Ë»ö¾î¸¦ 2ÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		document.wnsearch.query.focus();
		return;
	} else if ( skwd!="" )	{
		document.wnsearch.startCount_info.value = "0";
		document.wnsearch.startCount.value = "0";
		document.wnsearch.submit();
	}
}

function div_control(e) {
 if(e=="on") {   
  document.getElementById("fbanner").className = "on";   
 }   
 else {   
  document.getElementById("fbanner").className = "off";   
 }   
}  

function gointro(code) {
	if (code!="")	{
		//alert("goekdafsdf");
		parent.location.href="/intro/intro/organ_temp1.jsp?ocode="+code;
	}
}

function gointro2(code) {
	if (code!="")	{
		//alert("goekdafsdf");
		parent.location.href="/intro/intro/organ_temp1.jsp?ocode="+code+"&tabcurrentSeq=1";
	}
}


function childPrint(){
	try{
		iFrm.focus();
		iFrm.print();
	}catch(e){
		alert(e.description);
	}
}


var windowtitle="Image Window"  

function detectexist(obj){ return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight){

function getpos(){
    leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
    toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
        if (window.opera){
            leftpos-=screenLeft
            toppos-=screenTop
        }
    }
getpos()

var winattributes='width='+popwidth+',height='+popheight+',resizable=no,left='+leftpos+',top='+toppos

	if (typeof jkpopwin=="undefined" || jkpopwin.closed)
        jkpopwin=window.open("","",winattributes)
    else {
        jkpopwin.resizeTo(popwidth, popheight)
    }
    jkpopwin.document.open()
    jkpopwin.document.write('<html><title>'+windowtitle+'</title><body style="margin:0;"><img src="'+imgpath+'"></body></html>')
    jkpopwin.document.close()
    jkpopwin.focus()
}


function siteStatic(code){
	call_tempa_img = new Image();
	call_tempa_img.src = "/common/jsp/staticAction.jsp?code="+code;
}

var ifrmSrc;
function hideSelect(e) {
	if(document.getElementById("sumTotal_iframe")){
		if(e == "on") {
			ifrmSrc = document.getElementById("sumTotal_iframe").src;
			document.getElementById("sumTotal_iframe").src = "";
		}
		else {
			document.getElementById("sumTotal_iframe").src = ifrmSrc;
		}
	}
}

function overImg(imgEl) {
	var imgObj = document.getElementById(imgEl);
	if( imgObj.src.indexOf('_off.gif') > 0 ) {
		imgObj.src = imgObj.src.replace('off.gif','on.gif');
	}
}
function outImg(imgEl) {
	var imgObj = document.getElementById(imgEl);
	if( imgObj.src.indexOf('_on.gif') > 0 ) {
		imgObj.src = imgObj.src.replace('on.gif','off.gif');
	}
}

// [[ Image Rollover ]]
function PmenuOn(imgEl) {
	var isrc = document.getElementById('submenu'+imgEl);
	if( isrc.src.indexOf("_off.gif") > 0){
		isrc.src = isrc.src.replace("_off.gif", "_on.gif");
	}
}
function PmenuOut(imgEl) {
	var isrc = document.getElementById('submenu'+imgEl);
	if( isrc.src.indexOf("_on.gif") > 0){
		isrc.src = isrc.src.replace("_on.gif", "_off.gif");
	}
}// [[ END Image Rollover ]]



// [[ Image Rollover ]]
function menuOn(imgEl) {
	var isrc = imgEl.src;
	if( isrc.indexOf("_on.gif") < 0){
		imgEl.src = imgEl.src.replace("_off.gif", "_on.gif");
	}
}
function menuOut(imgEl) {
	var isrc = imgEl.src;
	if( isrc.indexOf("_on.gif") > -1){
		imgEl.src = imgEl.src.replace("_on.gif", "_off.gif");
	}
}// [[ END Image Rollover ]]



/* png ÀÌ¹ÌÁö Åõ¸í Àû¿ë script */
function setPng24(obj) {
 obj.width=obj.height="1";
 obj.className=obj.className.replace(/\bpng24\b/i,"");
 obj.style.filter= "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
 //obj.src=""; 
 return "";
}

//* image rollover *//

function LMenu_On() 
   { 
      var img_id = event.srcElement.id; 
      event.srcElement.src = "/image/menu/" + img_id + "_on.png"; 
   } 
function LMenu_Off() 
   { 
      var img_id = event.srcElement.id; 
      event.srcElement.src = "/image/menu/" + img_id + "_off.png"; 
   }


//*ÆîÄ§ ¸Þ´º *//
function leftMenu(menuIdx){

	for(i=1 ; i<=55 ; i++){
		try{
				objLayer = document.getElementById("sub"+i)

			if (i<=9){
				objImg = document.getElementById("Lmenu0"+i);
			}else{
				objImg = document.getElementById("Lmenu"+i);
			}
			if(i == menuIdx){
			 	objImg.src = objImg.src.replace("_off.png","_on.png");
				objLayer.style.display = "block";
			}else{
				objImg.src = objImg.src.replace("_on.png","_off.png"); 
				objLayer.style.display = "none"; 
			} 
		}catch(e){ }  
	} 
}

//*¸Þ´º¼³Á¤ *//
function menuMouseOver(idx){
	if(document.getElementById("Nheader")) document.getElementById("Nheader").style.zIndex = "1000"; 
      ///document.getElementById("Ncontainer").style.zIndex = "1";
	try{
		for(i=1 ; i<=6 ; i++){
			
			objImage = document.getElementById("menu"+i);
			objLayer = document.getElementById("topsub_gnb0"+i);
			if(i == idx){
				objImage.src = objImage.src.replace(i+"_off.gif", i+"_on.gif");
				objLayer.style.display = "block";
			}else{
				objImage.src = objImage.src.replace(i+"_on.gif", i+"_off.gif");
				objLayer.style.display = "none";
			}
		}
	}catch(err){
	
	}
} 

/*main*/
function mainMouseOver(idx){
	if(document.getElementById("mkheader")) document.getElementById("mkheader").style.zIndex = "1000";
	try{
		for(i=1 ; i<=6 ; i++){
			objImage = document.getElementById("menu"+i);
			objLayer = document.getElementById("topsub_gnb0"+i);
			if(i==idx){				
				objImage.src = objImage.src.replace(i+"_off.gif", i+"_on.gif");
				objLayer.style.display = "block";
			}else{
				objImage.src = objImage.src.replace(i+"_on.gif", i+"_off.gif");
				objLayer.style.display = "none";			
			}
		}
		
	}catch(err){
	
	}
}

function mainMouseOut(idx){
	if(document.getElementById("Nheader"))	document.getElementById("Nheader").style.zIndex = "1";
	if(document.getElementById("mkheader"))	document.getElementById("mkheader").style.zIndex = "1";
	objImage = document.getElementById("menu"+idx);
	objLayer = document.getElementById("topsub_gnb0"+idx);
	objImage.src = objImage.src.replace(idx+"_on.gif", idx+"_off.gif");
	objLayer.style.display = "none";	
}

function sub_topMouseOut(idx){
	objImage = document.getElementById("menu"+idx);
	objImage.src = objImage.src.replace(idx+"_off.gif", idx+"_on.gif");
}

// image roll
function tabMenuOver() {
	this.src = this.src.replace("off.gif", "on.gif");
}
function tabMenuOut() {
	this.src = this.src.replace("on.gif", "off.gif");
}
function initTabMenu(menuElId) {
	var tabMenu = document.getElementById(menuElId).getElementsByTagName("a");
	for(i=0; i<tabMenu.length; i++) {
		thismenu = tabMenu.item(i);
		thismenu.menuContainer = document.getElementById(menuElId);
		thismenu.targetEl = document.getElementById(tabMenu.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.getElementsByTagName("img").item(0).onmouseover = tabMenuOver;
		thismenu.getElementsByTagName("img").item(0).onmouseout = tabMenuOut;
		thismenu.onclick = tabMenuClick;
	}

	initmenu = tabMenu.item(0);
	initmenu.targetEl.style.display = "block";
	initmenu.getElementsByTagName("img").item(0).onmouseover();
	initmenu.getElementsByTagName("img").item(0).onmouseover = null;
	initmenu.getElementsByTagName("img").item(0).onmouseout = null;
	initmenu.menuContainer.current = initmenu;
}
function tabMenuClick() {
	currentmenu = this.menuContainer.current;
	if (currentmenu != this) {
		currentmenu.targetEl.style.display = "none";
		currentmenu.getElementsByTagName("img").item(0).onmouseover = tabMenuOver;
		currentmenu.getElementsByTagName("img").item(0).onmouseout = tabMenuOut;
		currentmenu.getElementsByTagName("img").item(0).onmouseout();
	
		this.targetEl.style.display = "block";
		this.getElementsByTagName("img").item(0).onmouseover = null;
		this.getElementsByTagName("img").item(0).onmouseout = null;
		this.menuContainer.current = this;
	}
	return false;
}

/* Á¤Ã¥Ä¿¹Â´ÏÆ¼ ÅÜ */
function commTab01(num) {
		for (i = 1; i < 5; i++) {
			if (num == i) {
				document.getElementById('commTab_0'+i+'').style.display='';
			} else {
				document.getElementById('commTab_0'+i+'').style.display='none';
			}
		}
	}

function loginChk(_retUrl){
	if(confirm('·Î±×ÀÎÀÌ³ª ½Ç¸íÀÎÁõÀÌ ÇÊ¿äÇÑ È­¸éÀÔ´Ï´Ù. ·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?')) {		
		location.href="/common/member/loginForm.jsp?retUrl="+_retUrl;
	}
}

function selectAttFile(_obj){
	fileCnt = _obj.value;
	for(i=1 ; i<=5 ; i++){
		if(i <= fileCnt){
			eval("document.all.fileDiv"+i+".style.display='';");				
		}else{
			eval("document.all.fileDiv"+i+".style.display='none';");				
		}
	}
}

function detailViewer(_code, _param) {
	switch(_code) {
		case 'news':		
			document.location = "/news/news/noticeView.jsp?"+_param;
			break;
		case 'realEconomy', 'medium', 'keyIndustry', 'grow', 'policyTrade', 'policyInvestment',
			 'fta', 'ordinarily', 'policyEnergy', 'resource', 'strategy', 'ccc':
			document.location = "/community/core/"+_param+".jsp";
			break;
		case 'bio', 'soft', 'robot', 'semiconductor', 'car', 'futureEnergy' :
			document.location = "/community/future/"+_param+".jsp";
			break;
		case 'research':
			document.location = "/community/inform/"+_param+".jsp";
			break;
		case 'trendInfo':
			document.location = "/community/inform/trendInfoView.jsp?"+_param;
			break;
		case 'primaryPolicy' :
			document.location = "/info/assembly/"+_param+".jsp";
			break;
		case 'dataList' :
		case 'todayEconomy' :
		case 'dic' :
		case 'ministerProfile', 'ministerTalk', 'ministerMsg', 'ministerSchedule':
			document.location = "/intro/minister/"+_param+".jsp";
			break;
		default:
	}
}	
// [[ Tab Contents ]]
function tabSwap02(num) {
	for (i = 1; i < 4; i++) {
		if (num == i) {
			document.getElementById('tab_00'+i+'').style.display='';
			document.getElementById('menu0'+i+'').src = "/image/main/Nmain/tab_r00"+i+"_on.gif";
		} else {
			document.getElementById('tab_00'+i+'').style.display='none';
			document.getElementById('menu0'+i+'').src = "/image/main/Nmain/tab_r00"+i+"_off.gif";
		}
	}
}// [[ END  Tab Contents ]]

// [[ poptap Contents ]]
function popSwap(num, maxSwapNum) {
	for (i = 1; i < maxSwapNum+1; i++) {
		if (num == i) {
			document.getElementById('popTab_0'+i+'').style.display='';
			document.getElementById('pop'+i+'').src = "/image/main/Nmain/popTab0"+i+"_on.gif";
		} else {
			document.getElementById('popTab_0'+i+'').style.display='none';
			document.getElementById('pop'+i+'').src = "/image/main/Nmain/popTab0"+i+"_off.gif";
		}
	}
}// [[ END poptap Contents ]]

//[[ START Åë°èÆË¾÷ ÀÚµ¿À¸·Î µ¹¾Æ°¡±â ]]
function popAutoSwap() {
	for(i = 1; i<5; i++) {
		
	}
}
//[[ END Åë°èÆË¾÷ ÀÚµ¿À¸·Î µ¹¾Æ°¡±â ]]
//[[ Åë°ètap Contents ]]
function statiSwap(num) {
	for (i = 1; i < 5; i++) {
		if (num == i) {
			document.getElementById('statiTab_0'+i+'').style.display='';
			document.getElementById('stati'+i+'').src = "/image/main/Nmain/infoTab0"+i+"_on.gif"
		} else {
			document.getElementById('statiTab_0'+i+'').style.display='none';
			document.getElementById('stati'+i+'').src = "/image/main/Nmain/infoTab0"+i+"_off.gif"
		}
	}
}// [[ END poptap Contents ]]

//[[ Åë°ètab include Contents ]]
function stati(num) {
	for (i = 1; i < 4; i++) {
		if (num == i) {
			document.getElementById('mkinfo_tab'+i+'').style.display='block';
			document.getElementById('stati'+i+'').src = "image/mkemain/info_tab0"+i+"_on.gif"
		} else {
			document.getElementById('mkinfo_tab'+i+'').style.display='none';
			document.getElementById('stati'+i+'').src = "image/mkemain/info_tab0"+i+"_off.gif"
		}
	}
}// [[ END poptap Contents ]]

function changeBanner(_num) {
	if(_num == 6) {
		document.getElementById('banerTab6').style.display='';
		for (i = 1; i < 6; i++) {
			document.getElementById('banerTab'+i+'').style.display='none';
		}
	} else {
		for (i = 1; i < 6; i++) {
			if(_num == i){
				document.getElementById('banerTab'+i+'').style.display='';
			}else{
				document.getElementById('banerTab'+i+'').style.display='none';
			}
		}
		document.getElementById('banerTab6').style.display='none';
	}
}

function checkBoxSelectedCount(arg) { 
	if (arg == undefined ) {
		return  0 ;
	}
	var len = arg.length ;

	var cnt = 0 ;
	if (cnt ==  undefined ) {
		if( arg.checked == true )   cnt  = cnt + 1 ;

	} else {
		for ( var i = 0 ; i < len ; i++ ) {
			if ( arg[i].checked == true ) {
				cnt = cnt + 1 ;
			}
		}
	}
	return cnt ;	
}


//quick
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 / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}
//quick end

//main banner start
var bannerArr = new Array();
var b_process = true; //trueÀÏ ¶§ ½ºÅ©·Ñ falseÀÏ ¶§ stop
var speed = 2; //½ºÅ©·Ñ¼Óµµ-ÀÛÀ»¼ö·Ïºü¸§

function initBanner(bannerBox, bannerContent, delay) {
	
	bannerArr[bannerArr.length] = bannerBox;	
	
	var bannerArrsum = 1; //initBannerÇÔ¼öÀüÃ¼È£Ãâ¼ö-Ãß°¡ÇÒ¶§¸¶´Ù¼öÁ¤¿äÇÔ
	bannerBox.delay = delay/(speed/bannerArrsum);
	bannerBox.moveOffset = bannerBox.offsetHeight;//Safari¸¸´Ù¸¥°ª.°¡²ûµÉ¶§µµÀÖÀ½.
	bannerBox.count = 0;
	bannerBox.bannerOver = false;
	bannerBox.cont = bannerContent;
	bannerBox.cont.currentHeight = 0;
 
	bannerBox.move = setInterval("moveBanners()", speed );
	p_num = bannerBox.move;
 
	for (i=0; i<bannerArr.length; i++) {
		bannerArr[i].onmouseover = function() { this.bannerOver=true; }
		bannerArr[i].onmouseout = function() { this.bannerOver=false; }
	}
}

function moveBanner_Change() {

	if(b_process == true){
		b_process = false;
		document.getElementById('b_play').src = '/image/mkmain/site_playbutton.png';
		document.getElementById('b_play').alt = '½ÃÀÛ';
		clearInterval(p_num);
	} else if(b_process == false){
		b_process = true;
		document.getElementById('b_play').src = '/image/mkmain/site_stopbutton_b.png';
		document.getElementById('b_play').alt = 'Á¤Áö';
		p_num = setInterval("moveBanners()", speed );
	}
}
 
function moveBanners() {

	
	for (i=0; i<bannerArr.length; i++) {
		if (bannerArr[i].cont.currentHeight % bannerArr[i].moveOffset == 0 && bannerArr[i].count < bannerArr[i].delay) {
			if(!bannerArr[i].bannerOver) bannerArr[i].count++;//bannerOver°¡ false ÀÏ¶§ Ä«¿îÆ®Áõ°¡½ÃÅ²´Ù
		} else {
			bannerArr[i].count = 0;
 
			bannerArr[i].cont.currentHeight -= bannerArr[i].moveOffset;//½ºÅ©·Ñ¾ÈÇÔ
 
			if (bannerArr[i].cont.currentHeight % (bannerArr[i].cont.offsetHeight) == 0) {
				bannerArr[i].cont.currentHeight = 0;
			}
			bannerArr[i].cont.style.top = bannerArr[i].cont.currentHeight + "px";
		}
	}
}
function prevBanner(bannerArrnum) {
	
	var bannerArrnum = bannerArrnum-1;
	bannerArr[bannerArrnum].count = 0;
	bannerArr[bannerArrnum].cont.currentHeight+= bannerArr[bannerArrnum].moveOffset;

	if (-bannerArr[bannerArrnum].cont.currentHeight < 0) {
			bannerArr[bannerArrnum].cont.currentHeight = bannerArr[bannerArrnum].moveOffset-bannerArr[bannerArrnum].cont.offsetHeight;
	}

	bannerArr[bannerArrnum].cont.style.top = bannerArr[bannerArrnum].cont.currentHeight + "px";
}
function nextBanner(bannerArrnum) {
	
	var bannerArrnum = bannerArrnum-1;
	bannerArr[bannerArrnum].count = 0;
	bannerArr[bannerArrnum].cont.currentHeight-= bannerArr[bannerArrnum].moveOffset;

	if (-bannerArr[bannerArrnum].cont.currentHeight >= bannerArr[bannerArrnum].cont.offsetHeight) {
		bannerArr[bannerArrnum].cont.currentHeight = 0;
	}
	
	bannerArr[bannerArrnum].cont.style.top = bannerArr[bannerArrnum].cont.currentHeight + "px";
}

function prevnextCheck(listname,mode,cnt){
	  var displayNo = "";
	  for(i=1;i<=cnt;i++){
	    var obj = document.getElementById(listname + i);
	    if(obj.style.display != "none"){
	      displayNo = i;
	      obj.style.display = "none";
	      break;
	    }
	  }
	        
	  if(mode == "prev") {
		  if(displayNo > 1){
		  displayNo = displayNo - 1;
		  }else{
			displayNo = 1;
		  }
	  }
	  if(mode == "next"){
		  if(displayNo < cnt){
			  displayNo = displayNo + 1;
		  }else{
			displayNo = cnt;
		  }
	  }
	  if(scrollingnewscount) scrollingnewscount = displayNo;
	  //if(displayNo < 1) displayNo = cnt;
	  //if(displayNo > cnt) displayNo = 1;
	        
	  var obj2 = document.getElementById(listname + displayNo);
	  obj2.style.display = "block";
}
//main banner end



//2011.0618 tabzone Yim
function showTab(num) {
	for (i = 1; i < 4; i++) {
		if (num == i) {
			document.getElementById('tab_notice0'+i+'').style.display='block';
			document.getElementById('moreTab'+i+'').style.display='block';
			document.getElementById('tabimage'+i+'').src = "/image/mkemain/notice_tab0"+i+"_on.gif"
		} else {
			document.getElementById('tab_notice0'+i+'').style.display='none';
			document.getElementById('moreTab'+i+'').style.display='none';
			document.getElementById('tabimage'+i+'').src = "/image/mkemain/notice_tab0"+i+"_off.gif"
		}
	}
}// [[ Tab and ]]


//2011.0618 tabzone Yim
function showTabsns(num) {
	for (i = 1; i < 4; i++) {
		if (num == i) {
			document.getElementById('tab_sns0'+i+'').style.display='block';
			//document.getElementById('moreTab'+i+'').style.display='block';
			//document.getElementById('tabsnsimage'+i+'').src = "/image/mkemain/snsimg0"+i+".gif"
			if(i == 1){
				document.getElementById('tabsnsimage1').src = "/image/mkemain/facebook_on.gif";
				document.getElementById('tabsnsimage2').src = "/image/mkemain/twitter_off.gif";
				document.getElementById('tabsnsimage3').src = "/image/mkemain/naver_off.gif";
			}else if(i == 2){
				document.getElementById('tabsnsimage1').src = "/image/mkemain/facebook_off.gif";
				document.getElementById('tabsnsimage2').src = "/image/mkemain/twitter_on.gif";
				document.getElementById('tabsnsimage3').src = "/image/mkemain/naver_off.gif";
			}else{
				document.getElementById('tabsnsimage1').src = "/image/mkemain/facebook_off.gif";
				document.getElementById('tabsnsimage2').src = "/image/mkemain/twitter_off.gif";
				document.getElementById('tabsnsimage3').src = "/image/mkemain/naver_on.gif";
			}
		} else {
			document.getElementById('tab_sns0'+i+'').style.display='none';
			//document.getElementById('moreTab'+i+'').style.display='none';
			//document.getElementById('tabsnsimage'+i+'').src = "/image/mkemain/snsimg0"+i+".gif"
		}
		
		
	}
}// [[ Tab and ]]

// var rcontents = new rotatecontents_pop('rcontents');
/*var rcontents = new rotatecontents('rcontents');
rcontents.rotatemethod='slide';
rcontents.buttonobject='rcontents_button';
rcontents.buttontype='image';
rcontents.buttononimagename='_on';
rcontents.initialize();
document.getElementById('popupplaybutton').style.display = "none"; */




