function insertFlash(swf, width, height, bgcolor, id, flashvars, title)
{
	var strFlashTag = new String();

	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
		strFlashTag += 'id="' + id + '" title="' + title + '" width="' + width + '" height="' + height + '">';
		strFlashTag += '<param name="movie" value="' + swf + '"/>';

		if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
		strFlashTag += '<param name="quality" value="best"/>';
		strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
		strFlashTag += '<param name="menu" value="false"/>';
		strFlashTag += '<param name="salign" value="LT"/>';
		strFlashTag += '<param name="scale" value="noscale"/>';
		strFlashTag += '<param name="wmode" value="transparent"/>';
		strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
		strFlashTag += '</object>';
	}
	else
	{


		strFlashTag += '<embed src="' + swf + '" ';
		strFlashTag += 'quality="best" ';
		strFlashTag += 'bgcolor="' + bgcolor + '" ';
		strFlashTag += 'width="' + width + '" ';
		strFlashTag += 'height="' + height + '" ';
		strFlashTag += 'menu="false" ';
		strFlashTag += 'scale="noscale" ';
		strFlashTag += 'id="' + id + '" ';
		strFlashTag += 'salign="LT" ';
		strFlashTag += 'wmode="transparent" ';
		strFlashTag += 'allowScriptAccess="sameDomain" ';
		if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
		strFlashTag += 'type="application/x-shockwave-flash" ';
		strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
		strFlashTag += '</embed>';
	}

	document.write(strFlashTag);
}

function insertFlash2(swf, width, height, bgcolor, id, flashvars, title,noobj)
{
	var strFlashTag = new String();


	strFlashTag += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="' + id + '" title="' + title + '" width="' + width + '" height="' + height + '" align="middle">';
	strFlashTag += '<param name="movie" value="' + swf + '" />';
	strFlashTag += '<param name="quality" value="best"/>';
	strFlashTag += '<param name="flashvars" value="'+flashvars+'" />';
	strFlashTag += '<param name="allowFullScreen" value="false" />';
	strFlashTag += '<param name="quality" value="high" />';
	strFlashTag += '<param name="wmode" value="transparent" />';
	strFlashTag += '<param name="scale" value="noscale"/>';
	strFlashTag += '<param name="bgcolor" value="#ffffff" />';
	strFlashTag += '<object type="application/x-shockwave-flash" data="' + swf + '" id="' + id + '_noobj" title="' + title + '" width="' + width + '" height="' + height + '">';
	strFlashTag += '<param name="flashvars" value="'+flashvars+'" />';
	strFlashTag += '<param name="quality" value="best"/>';
	strFlashTag += '<param name="menu" value="false"/>';
	strFlashTag += '<param name="salign" value="LT"/>';
	strFlashTag += '<param name="scale" value="noscale"/>';
	strFlashTag += '<param name="wmode" value="transparent"/>';
	strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';

	strFlashTag += noobj.innerHTML;
	strFlashTag += '</object>';
	strFlashTag += '</object>';
	 

	document.write(strFlashTag);
}
function goLink(url,tar){
	if(tar=="_self"){
	document.location.href=url;
	}else if(tar=="_blank"){
	window.open(url,'','');
	}else{
	document.location.href=url;
	}

}

function goMain(){
	document.location.href="/user/outlineMain.do?knd=2";

}
function IE_HtmlRewrite(objParent) {
	if (window.ActiveXObject && objParent) {
		objParent.innerHTML = objParent.innerHTML;
	}
}

function Popup(url,pnama,w,h,t,l,s){

	window.open(url,pnama,"width="+w+",height="+h+",top="+t+",left="+l+",scrollbars="+s+",status=no");

}


/* °æ°íÃ¢ */
function Walert(msg){
	alert(msg);
}
/* °æ°íÃ¢ */



/* È­¸é È®´ë Ãà¼Ò ½ÃÀÛ IE Àü¿ë */
 var nowZoom = 100; // ÇöÀçºñÀ²
 var maxZoom = 200; // ÃÖ´ëºñÀ²(500À¸·ÎÇÏ¸é 5¹è Ä¿Áø´Ù)
 var minZoom = 80; // ÃÖ¼ÒºñÀ²



 //È­¸é Å°¿î´Ù.
 function zoomIn() {
  if (nowZoom < maxZoom) {
   nowZoom += 10; //25%¾¿ Ä¿Áø´Ù.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }


 //È­¸é ÁÙÀÎ´Ù.
 function zoomOut() {
  if (nowZoom > minZoom) {
   nowZoom -= 10; //25%¾¿ ÀÛ¾ÆÁø´Ù.
  } else {
   return;
  }

  document.body.style.zoom = nowZoom + "%";
 }

function QuickMove(Quick){

	if (Quick)
	{
		document.getElementById("border").style.display="none";
		document.getElementById("title").style.display="none";
		document.getElementById("title2").style.display="block";

	}else{
		document.getElementById("border").style.display="block";
		document.getElementById("title").style.display="block";
		document.getElementById("title2").style.display="none";
	}
}

/* ±ÛÀÚ È®´ë Ãà¼Ò ¸ðµç ºê¶ó¿ìÁ® °ø¿ë */
// cookie µî·Ï
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");
}

// cookie »èÁ¦
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);
	}
}
}


function srolltop(){

	location.href="#wrapperAll";

}

/* ÇÁ¸°Æ® ÆË¾÷ */
function printContents(tit){
	var ww = "700";
	var hh = "577";
	var obj=document.getElementById("contents");
	document.footerform.titles.value=tit;
	document.footerform.contents.value=obj.innerHTML;

	var Printwin = window.open("","printContentsWindow","width="+ww+",height="+hh+",status=0,scrollbars=yes");
	document.footerform.submit();
}

/* ÇÁ¸°Æ® ÆË¾÷ */
function printContentsEN(tit){
	var ww = "678";
	var hh = "577";
	


	var win = window.open("/ehp/print_pop.jsp?titles="+tit,"printContentsWindow","width="+ww+",height="+hh+",menubar=0,scrollbars=no");
	//win.document.iframes.document.body.innerHTML="3333";
}



/* ÀÌ¸ÞÀÏ ÀÚµ¿ÀÔ·Â */
var disBg='#DBDBDB';

function chgEmail(txt,sel,current){
	if (typeof sel=='undefined')
	{
		return;
	}
	if (current)
	{
		for (i=0; i<sel.length; i++)
		{
			if (sel[i].value==current)
			{
				sel.selectedIndex=i;
				break;
			}
		}

		if (sel.selectedIndex==0) sel.selectedIndex=sel.length-1;
	}
	//else txt.value=sel.value;


	if (sel.selectedIndex<sel.length-1)
	{
		txt.readOnly=true;
		txt.style.backgroundColor=disBg;
		txt.value=sel.value;
	}
	else
	{
		txt.readOnly=false;
		//txt.style.backgroundColor='';
		if(txt.className=='ccc'){
			txt.style.backgroundColor='';
			txt.value='';
		}
	}
}



/*Åä±Û(µ¡±ÛÇü, ´©¸®²Û °Ô½ÃÆÇ)*/
function ViewDiv(id,tmp){

 if(tmp=="1"){

  eval("health_btn0" + id + "").style.display="none";
  eval("health_close0" + id + "").style.display="block";
  eval("show_health0" + id + "").style.display="block";

 }else{
  eval("health_btn0" + id + "").style.display="block";
  eval("health_close0" + id + "").style.display="none";
  eval("show_health0" + id + "").style.display="none";
 }

}



/*Åä±Û(¸®ÇÃ °Ô½ÃÆÇ)*/
function ViewDivRe(id,tmp){

 if(tmp=="1"){

  eval("health_btnRe0" + id + "").style.display="none";
  eval("health_closeRe0" + id + "").style.display="block";
  eval("show_healthRe0" + id + "").style.display="block";

 }else{
  eval("health_btnRe0" + id + "").style.display="block";
  eval("health_closeRe0" + id + "").style.display="none";
  eval("show_healthRe0" + id + "").style.display="none";
 }

}


/*´Þ·Â½ÃÀÛ*/
function ViewDivCalendar(id,tmp){

 if(tmp=="1"){

  eval("search_calendar").style.display="none";
  eval("search_calendar").style.display="block";
  eval("search_calendar").style.display="block";

 }else{
  eval("search_calendar").style.display="block";
  eval("search_calendar").style.display="none";
  eval("search_calendar").style.display="none";
 }

}

/*´Þ·ÂÁ¾·á*/
function ViewDivCalendar01(id,tmp){

 if(tmp=="1"){

  eval("search_calendar01").style.display="none";
  eval("search_calendar01").style.display="block";
  eval("search_calendar01").style.display="block";

 }else{
  eval("search_calendar01").style.display="block";
  eval("search_calendar01").style.display="none";
  eval("search_calendar01").style.display="none";
 }

}



/* ShowHideLayers */
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



function GnbRoll(size){
	if(document.getElementById("gnb_main")){
		document.getElementById("gnb_main").style.height=size + "px";
		document.getElementById("gnb_flash").style.height=size + "px";
		document.getElementById("gnb_flash_noobj").style.height=size + "px";
	}else{
		document.getElementById("gnb").style.height=size + "px";
		document.getElementById("gnb_flash").style.height=size + "px";
		document.getElementById("gnb_flash_noobj").style.height=size + "px";
	}
}

function LayerDown(){
		document.getElementById("footer_buttons2").style.display="none";
		document.getElementById("footer_buttons1").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="-98px";

	/*


	if(parseInt(document.getElementById("main_footer_menu").style.bottom) > -98){
		document.getElementById("main_footer_menu").style.bottom = (parseInt(document.getElementById("main_footer_menu").style.bottom) + 0.3 * (-102 - parseInt(document.getElementById("main_footer_menu").style.bottom))) + "px";
		window.setTimeout("LayerDown()",3);
	}else{
		document.getElementById("footer_buttons2").style.display="none";
		document.getElementById("footer_buttons1").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="-98px";
		return;
	}
	*/
}
function LayerUp(){	
		document.getElementById("footer_buttons1").style.display="none";
		document.getElementById("footer_buttons2").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="61px";
	/*
	if(parseInt(document.getElementById("main_footer_menu").style.bottom) < 0){
		document.getElementById("main_footer_menu").style.bottom = (parseInt(document.getElementById("main_footer_menu").style.bottom) + 0.3 * (0-parseInt(document.getElementById("main_footer_menu").style.bottom))) + "px";
		window.setTimeout("LayerUp()",3);
	}else{
		document.getElementById("footer_buttons1").style.display="none";
		document.getElementById("footer_buttons2").style.display="block";
		document.getElementById("main_footer_menu").style.bottom="0px";
	}
	*/
}


/*png »ç¿ë ÀÚ¹Ù½ºÅ©¸³Æ®*/
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 ''; 
}


function setFlashDivY(y){
	document.getElementById("flashLayer").style.top=y + "px";
}

function setFlashDivH(h){
	document.getElementById("flashLayer").style.height=h;
}



function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function tb_show(na,na2,na3){

	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	overHeight = arrayPageSize[1] + arrayPageScroll[1];
	document.getElementById("overlays").style.height=overHeight + "px";
	document.getElementById("overlays").style.display="block";

	aboutLeft = (arrayPageSize[0] - 864) / 2;

	//document.getElementById("about").style.left=aboutLeft + "px";

}

function tb_remove(){
	document.getElementById("overlays").style.display="none";
}

function Tot_search(qu){
	fo=document.footerform;
	fo.query.value=qu;
	fo.submit();
}

function overlays_resize(){
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	overHeight = arrayPageSize[1] + arrayPageScroll[1];
	document.getElementById("overlays").style.height=overHeight + "px";
}


function LinkSelectS(){
	if(document.foform.LinkSelect.value!=""){
	window.open(document.foform.LinkSelect.value,'','');
	}
}
function LinkSelect2(obj){
	document.location.href=obj[obj.selectedIndex].value;
}



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 title = 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 = a; 
		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='best'/>\n";
		parameter += "<param name='base' value='.'>\n";
		parameter += "<param name='scale' value='noscale'/>\n";
		parameter += "<param name='expressinstall' value='Scripts/expressInstall.swf' />\n";
	}
	
	this.parameter = function ( param, value ) {
		 parameter += "<param name='"+param +"' value='"+ value + "'>\n";
	}

	this.wmode = function ( value ) {
		wmode = value;
	}

	this.id = function ( value ) {
		id = value;
	}
	this.title = function ( value ) {
		title = value;
	}

	this.shocknone = 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+'" title="'+title+'" 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 + '2">' + 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;
		}
	}
}

