/*--------------------------------------------------------------------------*/
/*  $id Selector
/*--------------------------------------------------------------------------*/
/* getElementById : $id("id") */
function $id()	{
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}



/*--------------------------------------------------------------------------*/
/*  getElementsByClassName Selector
/*--------------------------------------------------------------------------*/
/* getElementsByClassName : getElementsByClassName("className","parentId","elementName")*/
document.getElementsByClassName = function(_class, el_id, elTag) {
	if (elTag == false || elTag == null) {
		elTag = '*';
	}
	var parent, els, returnArr = new Array(), i = 0;
	parent = (el_id) ? document.getElementById(el_id) : document;
	els = parent.getElementsByTagName(elTag) || parent.all;
	for (i; i < els.length; i++)
		if (els[i].className == _class) 
			returnArr[returnArr.length] = els[i];
	return returnArr;
}



/*--------------------------------------------------------------------------*/
/*  image on off
/*--------------------------------------------------------------------------*/
function imgOn(imgElement)
{
	imgElement.src = imgElement.src.replace("_off.gif", "_on.gif");
}

function imgOff(imgElement)
{
	imgElement.src = imgElement.src.replace("_on.gif", "_off.gif");
}



/*--------------------------------------------------------------------------*/
/*  IE Image Label check
/*--------------------------------------------------------------------------*/
function	ieLabel(el)	{
	if(navigator.appVersion.indexOf('MSIE') != -1)	{
		var labelFor = el.getAttribute("for")? el.getAttribute("for") : el.getAttribute("htmlFor")
		$id(labelFor).click();
	}
}



/*--------------------------------------------------------------------------*/
/*  enter key press check
/*--------------------------------------------------------------------------*/
function	enterCheck(el,event)	{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13) {
		el.onkeypress = el.onclick;
	}
	else {
		return false;
	}
}



/*--------------------------------------------------------------------------*/
/*  add event
/*--------------------------------------------------------------------------*/
function addEvent( obj, type, fn )
{
	if (obj.addEventListener)	/* Dom Standard */
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)	/* MS Script */
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}
/*
addEvent	(window, "load", function()	{
					
			}
);
*/

function showRsvt(param){
//<![CDATA[
	embedSWF("/medservice/flex/amc.swf?" + param, "flexLayer", "950", "610", "window", "flexLayerObject");
	// url, replace element id, width, height, wmode, object id
	setTransLayerPop("flexLayer");
}

/*--------------------------------------------------------------------------*/
/*  embed object
/*--------------------------------------------------------------------------*/
var embedSWF = function(url, replaceEl, width, height, wmode, objId)	{
	try	{
		if (document.write && document.getElementById)
		{
			if (wmode == false) wmode = "window";
			if (objId == false) objId = "flashObject";

			var replaceEl = document.getElementById(replaceEl);
			var replaceElContent = replaceEl.innerHTML;

			var objectStr = ''+
			'<!--[if IE]>' +
			'<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+'" id="'+objId+'">' +
			'<![endif] -->' +
			'<!--[if !IE]> <-->' +
			'<object type="application/x-shockwave-flash" data="'+url+'" width="'+width+'" height="'+height+'" id="'+objId+'">' +
			'<!--><![endif]-->' +
			'<param name="movie" value="'+url+'" />' +
			'<param name="wmode" value="'+wmode+'" />' +
			replaceElContent +
			'</object>';

			replaceEl.innerHTML = objectStr;
		}
	}
	catch (e)	{return false;}
}



/*--------------------------------------------------------------------------*/
/*  tabContents
/*--------------------------------------------------------------------------*/
function	tabContetns(tabId,tabMenuId)
{
	var moreBtn = document.getElementsByClassName("more",tabMenuId);
	var tabDivId = document.getElementById(tabId);
	var tabMenuId = document.getElementById(tabMenuId);

	var tabMenuAnchor = tabMenuId.getElementsByTagName("ul")[0].getElementsByTagName("a");

	var first=0;
	var temp = tabMenuAnchor[0].href.split("#")[1];

	for (i=0; i<tabMenuAnchor.length; i++)
	{
		var divName	= tabMenuAnchor[i].href.split("#")[1];
		document.getElementById(divName).style.display = "none";
		if ((moreBtn.length > 0) && (moreBtn[i] != null)) moreBtn[i].style.display = "none";

		if (first==0)
		{	
			document.getElementById(tabMenuAnchor[0].href.split("#")[1]).style.display = "block";
			if (moreBtn.length > 0) moreBtn[0].style.display = "block";
			if	(tabMenuId.getElementsByTagName("img")[0] !=null) {
				tabMenuId.getElementsByTagName("img")[0].src=
				tabMenuId.getElementsByTagName("img")[0].src.replace("_off","_on");
			}
			else	{
				tabMenuId.getElementsByTagName("li")[0].className="onTab";
			}
			first=1;
		}
		tabMenuAnchor[i].onclick = function()	{

			for	(j=0; j<tabMenuAnchor.length; j++)
			{
				if (tabMenuAnchor[j].getElementsByTagName("img")[0] != null)	{
					tabMenuAnchor[j].getElementsByTagName("img")[0].src = tabMenuAnchor[j].getElementsByTagName("img")[0].src.replace("_on","_off");
					this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace("_off","_on");
				}
				else	{
					tabMenuAnchor[j].parentNode.className="";
					this.parentNode.className="onTab";
				}
			}

			document.getElementById(temp).style.display = "none";
			divName	= this.href.split("#")[1];
			temp=divName;
			document.getElementById(divName).style.display = "block";

			if (moreBtn.length > 0)	{
				for	(k=0;k<tabMenuAnchor.length;k++)	{
					if (moreBtn[k] != null)	moreBtn[k].style.display = "none";
				}
				for	(l=0;l<tabMenuAnchor.length;l++)	{
					if (tabMenuAnchor.length == moreBtn.length && this==tabMenuAnchor[l])	moreBtn[l].style.display = "block";
					if (tabMenuAnchor.length != moreBtn.length) moreBtn[0].style.display = "block";
				}
			}

			return false;
		}
	}
}



/*--------------------------------------------------------------------------*/
/* switchContents
/*--------------------------------------------------------------------------*/
function	switchContents(switchId)	{
	var switchCon = document.getElementById(switchId);
	var switchConDd = switchCon.getElementsByTagName("dd");
	var switchConA = switchCon.getElementsByTagName("a");

	for (i=0;switchConDd.length>i ;i++)
	{
		if (switchConDd[i].parentNode==switchCon)	{
			switchConDd[i].style.display="none";
		}
	}

	for (j=0;switchConA.length>j ;j++)
	{
		if (switchConA[j].parentNode.nodeName=="DT" && switchConA[j].parentNode.parentNode==switchCon)	{
			switchConA[j].onclick = function()	{
				if (document.getElementById(this.href.split("#")[1]) && document.getElementById(this.href.split("#")[1]).style.display=="block")	{// ???????? ??????????
					document.getElementById(this.href.split("#")[1]).style.display="none";
				}
				else if (document.getElementById(this.href.split("#")[1]) && document.getElementById(this.href.split("#")[1]).style.display=="none")	{//?????????? ????????
					for (k=0;switchConDd.length>k ;k++)	{
						switchConDd[k].style.display="none";
					}
					document.getElementById(this.href.split("#")[1]).style.display="block";
				}
				return false;
			}
		}
	}
}



/*--------------------------------------------------------------------------*/
/*  replace input type file to image button
/*--------------------------------------------------------------------------*/
function	replaceInputFile(insertEl,imgSrc)	{
	var insertEl = $id(insertEl);
	var imgSrc = imgSrc;

	var createImg = document.createElement("img");
	createImg.setAttribute("src",imgSrc);
	createImg.setAttribute("alt","????????");

	insertEl.appendChild(createImg);
}



/*--------------------------------------------------------------------------*/
/*  top Login Bg
/*--------------------------------------------------------------------------*/
/*
addEvent	(window, "load", function()	{
				topInputBgControlOnload();
			}
);

function	topInputBgControlOnload()	{
	if ($id("topId") && $id("topId").value!='') $id("topId").style.backgroundImage = "url('')";
	if ($id("topId") && $id("topPW").value!='') $id("topPW").style.backgroundImage = "url('')";
	if ($id("topId") && $id("topSch").value!='') $id("topSch").style.backgroundImage = "url('')";
}
*/
function	topInputBgControl()	{
	if ($id("topId"))
	{
		$id("topId").onfocus=function()	{
			this.style.backgroundImage = "url('')";
		}
		$id("topId").onblur=function()	{
			if (this.value=='')	this.style.backgroundImage = "url('../../images/common/common/k_loginId.gif')";
		}
	}
	if ($id("topPW"))
	{
		$id("topPW").onfocus=function()	{
			this.style.backgroundImage = "url('')";
		}
		$id("topPW").onblur=function()	{
			if (this.value=='')	this.style.backgroundImage = "url('../../images/common/common/k_loginPW.gif')";
		}
	}
	/*
	if ($id("topSch"))
	{
		$id("topSch").onfocus=function()	{
			this.style.backgroundImage = "url('')";
		}
		$id("topSch").onblur=function()	{
			if (this.value=='')	this.style.backgroundImage = "url('../../images/common/common/k_loginSearch.gif')";
		}
	}
	*/
}

/*--------------------------------------------------------------------------*/
/* slideCateScroll
/*--------------------------------------------------------------------------*/

function startCateScrollScroll() {
    setTimeout("slideCateScroll()", 10);
}
function slideCateScroll(submenu) {
	if (submenu == 'allmenu') Sel_Height=400;
	if (submenu == 'medservice') Sel_Height=168;
	if (submenu == 'healthinfo') Sel_Height=196;
	if (submenu == 'cancer') Sel_Height=450;
    /* ???????? ?????????? */
    el = document.getElementById("tabInfo_hidden");
    if (el.heightPos == null || (el.isDone && el.isOn == false)) {
		if ($id("hiddenSchSelelct"))	$id("hiddenSchSelelct").style.display = "inline";
		$id("extra").style.zIndex = "999";
        el.isDone = false;
        el.heightPos = 1;
        el.heightTo = Sel_Height;
    } else if (el.isDone && el.isOn){
		if ($id("hiddenSchSelelct"))	$id("hiddenSchSelelct").style.display = "none";
        el.isDone = false;
        el.heightTo = 1;
    }
    if (Math.abs(el.heightTo - el.heightPos) > 1) {
        el.heightPos += (el.heightTo - el.heightPos) / 5;
        el.style.height = el.heightPos + "px";
        startCateScrollScroll();
    } else {
    if (el.heightTo == Sel_Height) {
        el.isOn = true;
    } else {
        el.isOn = false;
		$id("extra").style.zIndex = "1001";
    }
        el.heightPos = el.heightTo;
        el.style.height = el.heightPos + "px";
        el.isDone = true;
    }
}



/*--------------------------------------------------------------------------*/
/*  SwitchMenu
/*--------------------------------------------------------------------------*/

var persistmenu="yes" //"yes" or "no". Make sure each DIV content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only


function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("medsvs_navi").getElementsByTagName("div");  
		if(el.style.display != "block"){  
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="medsvs_snavi")  
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate


/* Web TV Multi List */
function	hideWebTVMulti(el)	{
	$id(el).style.display = "none";
}
function	viewWebTVMulti(el)	{
	if	($id(el.href.split("#")[1]).style.display == "none")	$id(el.href.split("#")[1]).style.display = "block";
	else	$id(el.href.split("#")[1]).style.display = "none";
}



/* mainRollBanner1 */
function mainRollBanner1()	{
	var mainRollImg = $id("mainRollBanner1").getElementsByTagName("li");
	var mainRollBtn = $id("mainRollBanner1Menu").getElementsByTagName("img");

	for (i=0;i<mainRollImg.length;i++)
	{
		mainRollImg[i].style.display='none';
	}
	mainRollImg[0].style.display='block';
	mainRollBtn[0].src = mainRollBtn[0].src.replace("_off","_on");
	var tempNowImg = 0;

	function mainRollInt()	{
		for (i=0;i<mainRollImg.length;i++)
		{
			mainRollImg[i].style.display='none';
			mainRollBtn[i].src = mainRollBtn[i].src.replace("_on","_off");
		}
		if	(tempNowImg==mainRollImg.length - 1) {
			mainRollImg[0].style.display = 'block';
			mainRollBtn[0].src = mainRollBtn[0].src.replace("_off","_on");
			tempNowImg=0;
		}
		else	{
			mainRollImg[tempNowImg + 1].style.display = 'block';
			mainRollBtn[tempNowImg + 1].src = mainRollBtn[tempNowImg + 1].src.replace("_off","_on");
			tempNowImg = tempNowImg + 1;
		}
	}

	var mainRollSi = setInterval(mainRollInt,4000);
	$id("mainRollBanner1").onmouseover = function()	{
		clearInterval(mainRollSi);
	}
	$id("mainRollBanner1").onmouseout = function()	{
		mainRollSi = setInterval(mainRollInt,4000);
	}

	for (var i=0;i<mainRollImg.length;i++)	{
		$id("mainRollBanner1Menu").getElementsByTagName("a")[i].onclick = function	()	{
			var liEl = this.parentNode.parentNode.getElementsByTagName("li");
			for (j=0;j<liEl.length;j++)
			{
				liEl[j].style.display='none';
				mainRollBtn[j].src = mainRollBtn[j].src.replace("_on","_off");
			}
			mainRollImg[this.href.split("mainRollBanner1_")[1]-1].style.display = 'block';
			mainRollBtn[this.href.split("mainRollBanner1_")[1]-1].src = mainRollBtn[this.href.split("mainRollBanner1_")[1]-1].src.replace("_off","_on");
			tempNowImg = this.href.split("mainRollBanner1_")[1]-1;
			return false;
		}
	}
}



/* mainRollBanner2 */
function mainRollBanner2()	{
	var mainRollImg = $id("mainRollBanner2").getElementsByTagName("li");
	var mainRollLeftBtn = $id("mainRollBanner2Left");
	var mainRollRightBtn = $id("mainRollBanner2Right");

	for (i=0;i<mainRollImg.length;i++)
	{
		mainRollImg[i].style.display='none';
	}
	mainRollImg[0].style.display='block';
	var tempNowImg = 0;

	function mainRollInt2()	{
		for (i=0;i<mainRollImg.length;i++)
		{
			mainRollImg[i].style.display='none';
		}
		if	(tempNowImg==mainRollImg.length - 1) {
			mainRollImg[0].style.display = 'block';
			tempNowImg=0;
		}
		else	{
			mainRollImg[tempNowImg + 1].style.display = 'block';
			tempNowImg = tempNowImg + 1;
		}
	}

	var mainRollSi2 = setInterval(mainRollInt2,4000);
	$id("mainRollBanner2").onmouseover = function()	{
		clearInterval(mainRollSi2);
	}
	$id("mainRollBanner2").onmouseout = function()	{
		mainRollSi2 = setInterval(mainRollInt2,4000);
	}

	mainRollLeftBtn.onclick = function	()	{
		var liEl = this.parentNode.parentNode.parentNode.getElementsByTagName("li");
		for (j=0;j<liEl.length;j++)
		{
			liEl[j].style.display='none';
		}
		if (tempNowImg==0)	{
			liEl[liEl.length-1].style.display='block';
			tempNowImg = liEl.length-1;
		}
		else	{
			liEl[tempNowImg-1].style.display='block';
			tempNowImg = tempNowImg-1;
		}
		return false;
	}
	mainRollRightBtn.onclick = function	()	{
		var liEl = this.parentNode.parentNode.parentNode.getElementsByTagName("li");
		for (j=0;j<liEl.length;j++)
		{
			liEl[j].style.display='none';
		}
		if (tempNowImg==liEl.length-1)	{
			liEl[0].style.display='block';
			tempNowImg = 0;
		}
		else	{
			liEl[tempNowImg+1].style.display='block';
			tempNowImg = tempNowImg+1;
		}
		return false;
	}
}



/* idChkInfoBox */
function	idChkInfoBox(value)	{
	if (value=="show")	$id("idChkInfoBox").style.display = "block";
	if (value=="hide")	$id("idChkInfoBox").style.display = "none";
}
/*--------------------------------------------------------------------------*/
/*  calendar Layer popup
/*--------------------------------------------------------------------------*/

function	viewLayerPop(clickPopIdEl)	{
	var clickPopId = document.getElementById(clickPopIdEl);
	clickPopId.style.display="block";
}
function	hideLayerPop(clickPopIdEl)	{
	var clickPopId = document.getElementById(clickPopIdEl);
	clickPopId.style.display="none";
}



/*--------------------------------------------------------------------------*/
/*  setRoll Banner
/*--------------------------------------------------------------------------*/
function setRoll(elId, interval, setNum)	{
	var el = this;// this ????????
	el.elId = elId;// element id ????
	el.interval = parseInt(interval);//?????? ?? ???? ????????
	el.setNum = parseInt(setNum);//?????? ?? ???? ????????

	el.setRollLi = document.getElementById(el.elId).getElementsByTagName("ul")[0].getElementsByTagName("li");// li???? ???? ????

	el.setRollLiLen = el.setRollLi.length;//?????? ???? ????

	el.tempNowImg = 1;//???? ???????? ?????? ???? ???? ???????? ????

	if (el.setRollLiLen > el.setNum)//?????? ?????? ?? ???????? ???? ?????? ?????? ?????? ????
	{
		// ???? ???? : ?????? ?????????? ???????? ???????? ????
		for (i=0;el.setRollLiLen>i;i++)	{
			el.setRollLi[i].style.display = "none";
		}
		for (j=0;el.setNum>j;j++)	{
			el.setRollLi[j].style.display = "block";
		}

		/* ???????? */
		el.roll = function()	{
			for (i=0;el.setRollLiLen>i;i=i+el.setNum)	{// ???? ?????? ?????? ?????? ???????? ???? ???? ????
				if (el.setRollLi[i].style.display == "block")	el.tempNowImg = i/el.setNum + 1;
			}

			for (j=0;el.setRollLiLen>j;j++)	{// ???? ????
				el.setRollLi[j].style.display = "none";
			}

			if (!el.setRollLi[el.tempNowImg*el.setNum])	el.tempNowImg = 0;//???????????? ?????? ?????????? 0???? ???? ???? ???????? ???? ???? ????????

			for (k=el.tempNowImg*el.setNum;(el.tempNowImg*el.setNum)+el.setNum>k;k++)	{//???? ???????? * ???????? ?????? ?????? ???????? ???????? ???????? ?????? ???? ?????? ???????? ??????
				if (el.setRollLi[k])	el.setRollLi[k].style.display = "block";
			}
		}

		/* ???????? */
		el.backRoll = function()	{
			for (i=0;el.setRollLiLen>i;i=i+el.setNum)	{// ???? ???? ????(???? ????)
				if (el.setRollLi[i].style.display == "block")	el.tempNowImg = i/el.setNum + 1;
			}

			for (j=0;el.setRollLiLen>j;j++)	{// ???? ????
				el.setRollLi[j].style.display = "none";
			}

			if (el.tempNowImg==1)	{//?? ???? ???????????? ?????? ???????? ???? ???? ????
				if (el.setRollLiLen%el.setNum==0)//?????? ?????? ?????????? ?????? ???????? ?????? ?????? ???? ????????
				{
					var setRollX = parseInt(el.setRollLiLen/el.setNum) - 1;
				}
				else var setRollX = parseInt(el.setRollLiLen/el.setNum);

				for (k=setRollX*el.setNum;(setRollX*el.setNum)+el.setNum>k;k++)	{//?????? ?????? ?????? ???????? ???? ???? ???? ???????? ???????? ?????? ???????? ??????
					if (el.setRollLi[k])	el.setRollLi[k].style.display = "block";
				}
			}

			else	{//?? ???? ???????? ????????
				for (k=(el.tempNowImg-2)*el.setNum;((el.tempNowImg-2)*el.setNum)+el.setNum>k;k++)	{//???? ?????????? 2?? ???? ???? ???? ???????? ????(?????? 1?????? 2?????? ?????? ????)
					if (el.setRollLi[k])	el.setRollLi[k].style.display = "block";
				}
			}
		}

		document.getElementById(el.elId).onmouseover = function()	{// onmouseover ?? ????
			clearInterval(el.setRoll);
		}

		document.getElementById(el.elId).onmouseout = function()	{// onmouseout ?? ???? ????
			el.setRoll = setInterval(el.roll,4000);
		}

		el.setRoll = setInterval(el.roll,4000);//setInterval ????
	}
}

function	setRollRight(el)	{//?????????? ???????? ???? ????
	el.roll();
}
function	setRollLeft(el)	{//???????? ???????? ???? ????
	el.backRoll();
}



/*--------------------------------------------------------------------------*/
/*  toggleView
/*--------------------------------------------------------------------------*/
function toggleView(target){
    var sTarget = target.href.split("#");
    var aTarget = document.getElementById(sTarget[sTarget.length-1]);
    if(aTarget.style.display == "none") aTarget.style.display = "block";
    else aTarget.style.display = "none";    
}

/*--------------------------------------------------------------------------*/
/*  tabBoard(multi menu ver)
/*--------------------------------------------------------------------------*/
function	tabBoard(tabId,tabMenuId)
{
	var moreBtn = document.getElementsByClassName("more",tabMenuId); //more ???? ????
	var tabDivId = document.getElementById(tabId); //div id ?????? ????
	var tabMenuId = document.getElementById(tabMenuId); //div id ?????? ????

	//???? ?????? ???? ?????? ???? (???? ?????? ?????? ?????? ????) ???? ????(ul)???? ???? ?????? ???????? ???? ????
	var tabMenuAnchor = tabMenuId.getElementsByTagName("ul")[0].getElementsByTagName("a");

	var first=0; //???? ?????? ?????? ?????? ???? ????????
	var temp = tabMenuAnchor[0].href.split("#")[1]; //???? ???????? ???? ???? ????

	for (i=0; i<tabMenuAnchor.length; i++)
	{
		var divName	= tabMenuAnchor[i].href.split("#")[1]; //href?? #?? ???????? ?????? ?????? ????(?? ???? div id ????)
		document.getElementById(divName).style.display = "none"; //???? ???? div?? ???? ????????
		if ((moreBtn.length > 0) && (moreBtn[i] != null)) moreBtn[i].style.display = "none"; //more ?????? ?????? ???? ????????

		if (first==0) // ???????? ???????? ??????????
		{	
			document.getElementById(tabMenuAnchor[0].href.split("#")[1]).style.display = "block"; // ?????? ?????? ?????? ??
			if (moreBtn.length > 0) moreBtn[0].style.display = "block"; // more ?????? ?????? 1?? more?? ??????
			if	(tabMenuId.getElementsByTagName("img")[0] !=null) {//?????? ????????
				tabMenuId.getElementsByTagName("img")[0].src=
				tabMenuId.getElementsByTagName("img")[0].src.replace("_off","_on");//1?? ???? ??
			}
			else	{//?????? ????????
				tabMenuId.getElementsByTagName("li")[0].className="onTab";//1?? ???? onTab ??????
			}
			first=1; //?????????? ?????? ????
		}
		// ?????? ?????? ??????????
		tabMenuAnchor[i].onclick = function()	{

			for	(j=0; j<tabMenuAnchor.length; j++)	//?????? off,on source (???????? ???????? ????)
			{
				if (tabMenuAnchor[j].getElementsByTagName("img")[0] != null)	{//?????? ????????
					tabMenuAnchor[j].getElementsByTagName("img")[0].src = tabMenuAnchor[j].getElementsByTagName("img")[0].src.replace("_on","_off");//???? ????
					this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace("_off","_on");//?????? ???? ??
				}
				else	{//?????? ????????
					tabMenuAnchor[j].parentNode.className="";//?????? ???? ???? li ?????? ????
					this.parentNode.className="onTab";//?????? ???? li onTab ??????
				}
			}

			document.getElementById(temp).style.display = "none";  //???? ?????? ?????? ???? ????????
			divName	= this.href.split("#")[1] //tabMenuAnchor[i].href.split("#")[1];  ???? ?????? ?????? ???? div id?? ????
			temp=divName; // ???????? ?????????? ????
			document.getElementById(divName).style.display = "block"; //???????? ???? div ??????

			if (moreBtn.length > 0)	{// more???? ???? ????
				for	(k=0;k<tabMenuAnchor.length;k++)	{
					if (moreBtn[k] != null)	moreBtn[k].style.display = "none";
				}
				for	(l=0;l<tabMenuAnchor.length;l++)	{
					if (tabMenuAnchor.length == moreBtn.length && this==tabMenuAnchor[l])	moreBtn[l].style.display = "block";//?????????? more?? ?????? more ????
					if (tabMenuAnchor.length != moreBtn.length) moreBtn[0].style.display = "block";
					//???????? more?? ???? ???? ?????? ?????? more?? ???? ??????
				}
			}

			return false; // ???????? ???? ???????? ????
		}
	}
}

/*--------------------------------------------------------------------------*/
/*  print_this
/*--------------------------------------------------------------------------*/
   function printDiv(){
        if(document.body && window.print){
            window.onbeforeprint = beforeDivs;
            window.onafterprint = afterDivs;
            window.print();
        }
    }
    function beforeDivs(){
        if(document.body){
            objContents.style.display = 'none';
            objSelection.innerHTML = document.all['d1'].innerHTML;
        }
    }
    function afterDivs(){
        if(document.body){
        objContents.style.display = 'block';
        objSelection.innerHTML = "";
        }
    }


/*--------------------------------------------------------------------------*/
/*  scroll top value check
/*--------------------------------------------------------------------------*/
function	scrollTop()	{
	var scrollTop = document.scrollTop ? document.scrollTop : document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
	return scrollTop;
}


/*--------------------------------------------------------------------------*/
/*  for reserve flex
/*--------------------------------------------------------------------------*/
function	clientWidth()	{
	var clientWidth = document.clientWidth ? document.clientWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;//clientWidth
	return clientWidth;
}
function	clientHeight()	{
	var clientHeight = document.clientHeight ? document.clientHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;//clientHeight
	return clientHeight;
}
function	setTransLayerPop(popId)	{
	var popId = document.getElementById(popId);
	popId.style.left = (clientWidth()/2) - (popId.offsetWidth/2) + "px";
	popId.style.top = parseInt(scrollTop()) + 10 + "px";
	/*popId.style.top = (clientHeight()/2) - (popId.offsetHeight/2) + "px";*/
	popId.style.display = "none";
	popId.style.zIndex = "10000";

	if (!document.getElementById("opacityDiv"))
	{
		var opacityDiv = document.createElement("div");
		opacityDiv.id = "opacityDiv";
		opacityDiv.style.height = document.body.offsetHeight + 10 + "px";
		document.body.appendChild(opacityDiv);
	}
}


function viewTransLayerPop(clickPopIdEl, param)	{
	
	if(!isMember){
		if(document.URL.indexOf('/children/') != -1){
			document.location.href = "/children/member/login/login.do?prevURI="+prevURI;
		}else if(document.URL.indexOf('/dept/') != -1){
			document.location.href = "/dept/member/login.do?prevURI="+prevURI + "&dtCode=" + dtCode;
		}else{
			document.location.href = "/common/member/login.do?prevURI="+prevURI;
		}
		return;
	}
	
	ACEM_Track('/resv/flex.do');

 	if(param ==null) param = "";
 	showRsvt(param);
	var clickPopId = document.getElementById(clickPopIdEl);

	document.getElementById("opacityDiv").style.display="block";
	clickPopId.style.display="block";

	if (document.getElementById("forIEIframe"))	document.body.removeChild(document.getElementById("forIEIframe"));

	if(navigator.appVersion.indexOf('MSIE') != -1)
	{
		var forIEIframe = document.createElement("iframe");
		forIEIframe.id = "forIEIframe";
		forIEIframe.scrolling = "no";
		forIEIframe.setAttribute("frameBorder", "0");
		forIEIframe.style.position = "absolute";
		forIEIframe.style.zIndex = "9999";
		forIEIframe.style.width = clickPopId.offsetWidth;
		forIEIframe.style.height = clickPopId.offsetHeight;
		forIEIframe.style.left = (clientWidth()/2) - (clickPopId.offsetWidth/2) + "px";
		forIEIframe.style.top = parseInt(scrollTop()) + 10 + "px";
		//forIEIframe.style.top = (clientHeight()/2) - (clickPopId.offsetHeight/2) + "px";
		forIEIframe.style.backgroundColor = "#FFFFFF";
		document.body.appendChild(forIEIframe);
	}

	document.getElementById("opacityDiv").onclick = function()	{
		//hideTransLayerPop(clickPopIdEl);
		//document.location.reload();
	}
}

function	hideTransLayerPop(clickPopIdEl)	{
	var clickPopId = document.getElementById(clickPopIdEl);
	document.getElementById("opacityDiv").style.display="none";
	clickPopId.style.display="none";
	if (document.getElementById("forIEIframe"))	document.body.removeChild(document.getElementById("forIEIframe"));
}


/* insert blank title */
function	blankTitle()	{
	var imgTag = document.getElementsByTagName("img");
	var inputTag = document.getElementsByTagName("input");
	for (i=0;i<imgTag.length;i++)
	{
		if (imgTag[i].title==null || imgTag[i].title=="")	{
			imgTag[i].title="";
		}
	}
}

/*--------------------------------------------------------------------------*/
/*  for subSlideMenu(Left)
/*--------------------------------------------------------------------------*/
function	subSlideMenu(subSlideMenuId,firstOn)	{
	var subSlideMenu = document.getElementById(subSlideMenuId);// ?????? id ????????
	var menuUl = subSlideMenu.getElementsByTagName("ol");// ?????? ?? ol ???? ????????
	var menuLink = subSlideMenu.getElementsByTagName("a");// ?????? ?? a ???? ????????
	var menuImg = subSlideMenu.getElementsByTagName("img");// ?????? ?? img ???? ????????

	subSlideMenuFirst(); // ?????? ???? ????

	function	subSlideMenuFirst()	{//?????? ???? (1depth ???? ???? ????)
		for (i=0;menuUl.length>i;i++)//???? ??????
		{
			if (menuUl[i].parentNode != subSlideMenu)// ?????? ?????? div ?? ????(1?????? ????) ul?? 
			{
				menuUl[i].style.display = "none"; //????????
			}
		}
	}

	// ????????
/*	for (j=0;menuLink.length>j;j++) // a????
	{
		menuLink[j].onclick = function()	{ //??????
			var thisChild = this.parentNode.childNodes; //?? a?????? ????(li)?? ?????? ????????
			var thisEl = this; //?? a ???? ????????
			for (k=0;thisChild.length > k;k++) //li?? ?????? ??
			{
				if (thisChild[k].nodeName=="OL" && thisChild[k].style.display == 'none') { //???? ul?? ???????? ??????
					subSlideMenuFirst(); //???? ?????? ??????
					thisChild[k].style.display = 'block'; // li?? ???? ul (????????)?? ?????? ??
					while (thisEl.parentNode.parentNode) { // ?????? ???????? ?????? ?????????? ????(1???? li????)
						if (thisEl == subSlideMenu) break; // ?? ?????? ?????????? ???????? (???? ???????? ?????? ???????? ???? ????
						thisEl.parentNode.style.display = 'block'; // ???????? ???? block (ul?? li??)
						thisEl = thisEl.parentNode; // ?? ?????? ?????????? ???????? ???? ????
					}
					return false;//???? ???? ????
				}
				else if (thisChild[k].nodeName=="OL" && thisChild[k].style.display == 'block') { //???? ul?? ?????? ??????
					thisChild[k].style.display = 'none'; // ???? ul?? ????????
					return false;//???? ???? ????
				}
			}
		}
	}
*/
	//?????? ???????? ??????
	for (l=0;menuImg.length > l;l++)
	{
		menuImg[l].onmouseover = function()	{
			this.src = this.src.replace("_off","_on");
		}
		menuImg[l].onmouseout = function()	{
			this.src = this.src.replace("_on","_off");
		}
	}

	if (firstOn) // ???? on ??????
	{
		if (document.getElementById(firstOn).getElementsByTagName("img").length > 0)//?????? ??????????
		{
			document.getElementById(firstOn).getElementsByTagName("img")[0].src = document.getElementById(firstOn).getElementsByTagName("img")[0].src.replace("_off","_on");//??????
			document.getElementById(firstOn).getElementsByTagName("img")[0].onmouseover = "";//???? ???????? ?????? ???? ????
			document.getElementById(firstOn).getElementsByTagName("img")[0].onmouseout = "";//???? ???????? ?????? ???? ????
		}
		else	{//?????? ??????????
			document.getElementById(firstOn).className = "leftOn";//leftOn ?????? ????
		}
		var onEl = document.getElementById(firstOn); //???? on ???????? ???? ????
		while (onEl.parentNode.parentNode) { // ?????? ???????? ?????? ?????????? ????(1???? li????)
			if (onEl == subSlideMenu) break; // ?? ?????? ?????????? ???????? (???? ???????? ?????? ???????? ???? ????
			onEl.parentNode.style.display = 'block'; // ???????? ???? block (ul?? li??)
			onEl = onEl.parentNode; // ?? ?????? ?????????? ???????? ???? ????
		}
	}
}

/*--------------------------------------------------------------------------*/
/*  scroll News
/*--------------------------------------------------------------------------*/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

/*--------------------------------------------------------------------------*/
/*  subSlideMenu ???? ?????? (???????? ????)
/*--------------------------------------------------------------------------*/
function	hospitalLeft(subSlideMenuId,firstOn,etc)	{
	try
	{
		var subSlideMenu = document.getElementById(subSlideMenuId);
		var menuUl = subSlideMenu.getElementsByTagName("ol");
		var menuLink = subSlideMenu.getElementsByTagName("a");
		var menuImg = subSlideMenu.getElementsByTagName("img");

		function	subSlideMenuFirst()	{
			for (i=0;menuUl.length>i;i++)
			{
				if (menuUl[i].parentNode.parentNode != subSlideMenu)
				{
					menuUl[i].style.display = "none";
				}
			}
		}
		
		subSlideMenuFirst();	

/*		for (j=0;menuLink.length>j;j++)
		{
			menuLink[j].onclick = function()	{
				if (this.parentNode.getElementsByTagName("li")[0])
				{
					if ((this.parentNode.parentNode.parentNode == subSlideMenu) && (this.href == this.parentNode.getElementsByTagName("li")[0].getElementsByTagName("a")[0].href))	{
						var thisChild = this.parentNode.childNodes;
						var thisEl = this;
						for (k=0;thisChild.length > k;k++)
						{
							if (thisChild[k].nodeName=="OL" && thisChild[k].style.display == 'none') {
								subSlideMenuFirst();
								thisChild[k].style.display = 'block';
								while (thisEl.parentNode.parentNode) {
									if (thisEl == subSlideMenu) break;
									thisEl.parentNode.style.display = 'block';
									thisEl = thisEl.parentNode;
								}
								return false;
							}
							else if (thisChild[k].nodeName=="OL" && thisChild[k].style.display == 'block') {
								thisChild[k].style.display = 'none';
								return false;
							}
						}
					}
				}
			}
		}
*/
		for (l=0;menuImg.length > l;l++)
		{
			menuImg[l].onmouseover = function()	{
				this.src = this.src.replace("_off","_on");
			}
			menuImg[l].onmouseout = function()	{
				this.src = this.src.replace("_on","_off");
			}
		}

		if (firstOn)
		{
			var firstOn = firstOn.substring(0,4);
			var chkFirstOn = "left" + firstOn;
			if (!document.getElementById(chkFirstOn))
			{
				firstOn = firstOn.substring(0,3);
			}
			var firstOn = "left" + firstOn;
			if (document.getElementById(firstOn).getElementsByTagName("img").length > 0)
			{
				if(document.getElementById(firstOn).parentNode.parentNode.getElementsByTagName("img")[0].src)	{
					document.getElementById(firstOn).parentNode.parentNode.getElementsByTagName("img")[0].src = document.getElementById(firstOn).parentNode.parentNode.getElementsByTagName("img")[0].src.replace("_off","_on");//??????
				}
				document.getElementById(firstOn).getElementsByTagName("img")[0].src = document.getElementById(firstOn).getElementsByTagName("img")[0].src.replace("_off","_on");//??????
				if(document.getElementById(firstOn).parentNode.parentNode.getElementsByTagName("img")[0].src)	{
					document.getElementById(firstOn).parentNode.parentNode.getElementsByTagName("img")[0].onmouseover = "";
					document.getElementById(firstOn).parentNode.parentNode.getElementsByTagName("img")[0].onmouseout = "";
				}
				document.getElementById(firstOn).getElementsByTagName("img")[0].onmouseover = "";
				document.getElementById(firstOn).getElementsByTagName("img")[0].onmouseout = "";
			}
			var onEl = document.getElementById(firstOn);
			while (onEl.parentNode.parentNode) {
				if (onEl == subSlideMenu) break;
				onEl.parentNode.style.display = 'block';
				onEl = onEl.parentNode;
			}
			if (document.getElementById(firstOn).getElementsByTagName("ol")[0])
			{
				document.getElementById(firstOn).getElementsByTagName("ol")[0].style.display = 'block';
			}
		}
	}
	catch (e)
	{
		return false;
	}
}

/*--------------------------------------------------------------------------*/
/*  gate search
/*--------------------------------------------------------------------------*/

function toggleSelect(target){
    var sTarget = target.href.split("#");
    var aTarget = document.getElementById(sTarget[sTarget.length-1]);
    if(aTarget.style.display == "none") aTarget.style.display = "block";
    else aTarget.style.display = "none";    
}
function	mainSearchClick(n,el)	{
	$id("mainSearchOnImg").src = el.getElementsByTagName("img")[0].src;
	$id("mainSearchOnImg").src = $id("mainSearchOnImg").src.replace(".gif","_on.gif");
	$id("selectLayerview").style.display = "none";
}