/* image rollover */
function imgOn(imgEl) {
	imgEl.src = imgEl.src.replace("_off.gif", "_on.gif");
}
function imgOff(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", "_off.gif");
}

/* show/hide */
function layerShow(layer) {
	var layerid = document.getElementById(layer);
	layerid.style.display = "block";
}
function layerHide(layer) {
	var layerid = document.getElementById(layer);
	layerid.style.display = "none";
}

/* Åä±Û*/
function togCall(cal) {
	if (typeof cal == "string") {
		if (cal.split("#")[1]) {
			imgcal = document.getElementById('btn-'+ cal.split("#")[1]);
			cal = document.getElementById(cal.split("#")[1]);
		} else {
			imgcal = document.getElementById('btn-'+cal);
			cal = document.getElementById(cal);
		}
	}
	if (cal.style.display != "block") {
		cal.style.display = "block";
		if(imgcal != '') {
			imgcal.alt = imgcal.alt.replace("º¸±â", "´Ý±â");
			imgcal.src = imgcal.src.replace("_on.gif", "_off.gif");
		}
	} else {
		cal.style.display = "none";
		if(imgcal != '') {
			imgcal.alt = imgcal.alt.replace("´Ý±â", "º¸±â");
			imgcal.src = imgcal.src.replace("_off.gif", "_on.gif");
		}
	}
}
/* ¹Ù·Î°¡±â Åä±Û*/
function togCalgo(cal) {
	if (typeof cal == "string") {
		if (cal.split("#")[1]) {
			var imgcal = document.getElementById('btn-'+ cal.split("#")[1]);
			cal = document.getElementById(cal.split("#")[1]);
		} else {
			var imgcal = document.getElementById('btn-'+cal);
			cal = document.getElementById(cal);
		}
	}
	if (cal.style.display != "block") {
		cal.style.display = "block";
		if(imgcal != '') {
			imgcal.alt = imgcal.alt.replace("º¸±â", "´Ý±â");
			imgcal.src = imgcal.src.replace("_on.gif", "_off.gif");
		}
	} else {
		cal.style.display = "none";
		imgcal.src = imgcal.src.replace("_off", "_on");
		if(imgcal != '') {
			imgcal.alt = imgcal.alt.replace("´Ý±â", "º¸±â");
			imgcal.src = imgcal.src.replace("_off.gif", "_on.gif");
		}
	}
	var lnk = cal.getElementsByTagName("a");
	for (i=0; i<lnk.length; i++) {
		lnk[i].onclick = function() {
			cal.style.display = "none";
			if(imgcal != '') {
				imgcal.alt = imgcal.alt.replace("´Ý±â", "º¸±â");
				imgcal.src = imgcal.src.replace("_off.gif", "_on.gif");
			}
		}
	}
}

/* boardToggle */
function boardToggle(el) {
	var toggleContainer = document.getElementById(el);
	triggers = toggleContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (toggleContainer.current == this) {
				this.targetEl.style.display = "none";
				this.className = "";
				toggleContainer.current = null;
			} else {
				if (toggleContainer.current) {
					toggleContainer.current.targetEl.style.display = "none";
					toggleContainer.current.className = "";
				}
				this.targetEl.style.display = "";
				this.className = "selected";
				toggleContainer.current = this;
			}
			return false;
		}
	}
}


/* initTab */
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("ul")[0].getElementsByTagName("a");
	var i = 0;

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

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

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

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

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
/* initTab2 */
function initTabMenu2(el, menuel) {
	var toggleContainer = document.getElementById(el);
	var tmenuel = document.getElementById(menuel);
	triggers = toggleContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			if (triggers.item(i).href.split("#")[1] == menuel){
				var imgtmenuel = triggers.item(i).getElementsByTagName("img");
				imgtmenuell = imgtmenuel[0]
			}
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);
		

		if (!triggers.item(i).targetEl)
			continue;
		if (triggers.item(i).targetEl == tmenuel) {
			imgtypeall = triggers.item(i).getElementsByTagName('img');
			imgtypeall[0].src = imgtypeall[0].src.replace("off", "on");
		} else {
			triggers.item(i).targetEl.style.display = "none";
			imgtypeall = triggers.item(i).getElementsByTagName('img');
			imgtypeall[0].src = imgtypeall[0].src.replace("on", "off");
		}

		triggers.item(i).onclick = function () {
			imgtype = this.getElementsByTagName('img');
			if (toggleContainer.current == this) {
				return false;
			} else {
				if (toggleContainer.current) {
					toggleContainer.current.targetEl.style.display = "none";
					toggleContainer.current.className = "";
					imgoff = toggleContainer.current.getElementsByTagName('img');
					imgoff[0].src = imgoff[0].src.replace("on", "off");
				}
				if(tmenuel){
					tmenuel.style.display = "none";
					imgtmenuell.src = imgtmenuell.src.replace("on", "off");
				}
				this.targetEl.style.display = "block";
				this.className = "selected";
				toggleContainer.current = this;
				imgtype[0].src = imgtype[0].src.replace("off", "on");
			}
			return false;
		}
	}
}
/* print */
var printpp 
function bp()
{ 
printpp = document.body.innerHTML; 
document.body.innerHTML = content.innerHTML; 
} 
function ap()
{
document.body.innerHTML = printpp; 
} 

function printArea() { 
//window.onbeforeprint = bp; window.onafterprint = ap; 
window.print();
 
}



/* ¸ÞÀÎ-¹è³Ê ·Ñ¸µ */
var banner_1_mouseEvent = 1; 
var banner_2_mouseEvent = 1; 
<!-- 
// banner_roll("divÅÂ±× id", ¹è³Ê1°³³ôÀÌ, µô·¹ÀÌ, 1Ä­ÀÌµ¿¼Óµµ, 0); 
function banner_roll(div_id, banner_height, banner_delay, banner_speed, this_height){ 
     
    if(eval(div_id + "_mouseEvent")){ 
        var div_tag = document.getElementById(div_id); 
        var a_tag, i; 
        this_height++; 
        if(this_height < banner_height){ 
            div_tag.style.top = -this_height; 
            setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed); 
        } 
        else{ 
            a_tag = div_tag.getElementsByTagName("li"); 
            div_tag.appendChild(a_tag[0]); 
            div_tag.style.top = 0; 
            div_tag.style.bottom = 0; 
            setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0);", banner_delay); 
        } 
    } 
    else{ 
        setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed); 
    } 
    return true; 
} 

 
var globopObject;
var opIndex=0;
var cleared=true;
var direction=10;

// dynOpacity ÇÔ¼ö ¼³Á¤
function dynOpacity(opObject,stop)
{
if (stop)
{
clearInterval(window.tm);
cleared=true;
opIndex=10;
return;
}
globopObject=opObject;
if (opIndex>110) direction=-4;
if (opIndex<0) direction=4;
opIndex+=direction;
globopObject.style.filter='alpha(opacity:' + opIndex + ')';
if (cleared)
{
window.tm=setInterval("dynOpacity(globopObject,false);",20);
cleared=false;
}
//alert(window.tm);

}

function handleevent()
{

if (event.type=="mouseover")
  if(event.srcElement.tagName=="IMG")
        if (event.srcElement.parentElement.tagName=="A")    
          {
        dynOpacity(event.srcElement,false);
        }
if (event.type=="mouseout")
  if(event.srcElement.tagName=="IMG")
          {
        event.srcElement.style.filter="";
        dynOpacity(event.srcElement,true);    
        }
}
document.onmouseover=handleevent;
document.onmouseout=handleevent;





// #############################################################
// #### ±ÔÇÏ Ãß°¡
// #############################################################


function OpenWin0(url, winName, intWidth, intHeight, scroll) {
  window.open(url, winName, "width=" + intWidth + ", height=" + intHeight + ", resizable=0, scrollbars=" + scroll + ", top=" + ((screen.height / 2 - intHeight / 2) - 30) + ", left=" + (screen.width / 2 - intWidth / 2)) ;
}

function num_cm(num) {
  var max = 10;
  var dec = 0;
  num = num + "";

  //ÃÖ´ëÀÔ·ÂÄ¡ È®ÀÎ
  if( max < num.length && "" != max ) {
    alert('Á¤¼öºÎ´Â '+ max + ' ÀÚ¸® ÀÌ³»·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä.');
  }

  if(3 < num.length ) {
    //Ã¹¹øÂ°ÄÄ¸¶ÀüÀÇ¼ýÀÚÃëµæ
    var mod = num.length % 3;
    wrtNum = (mod > 0 ? (num.substring(0,mod)):'');
    //Ã¹¹øÂ°ÄÄ¸¶ÀÌÈÄÀÇ¼ýÀÚÃëµæ(3ÀÚ¸®´ÜÀ§·ÎÃëµæ)
    for( cnt=0; cnt < Math.floor(num.length/3); cnt++ ) {
      if((0==mod) && (0==cnt)) {
        wrtNum = wrtNum + num.substring(0,3);
      } else {
        wrtNum = wrtNum + ","+ num.substring( (cnt*3)+mod, (cnt*3)+mod+3 );
      }
    }
  } else {
    wrtNum = num;
  }

  return wrtNum;
}

function trim(str){
  //Á¤±Ô Ç¥Çö½ÄÀ» »ç¿ëÇÏ¿© È­ÀÌÆ®½ºÆäÀÌ½º¸¦ ºó¹®ÀÚ·Î ÀüÈ¯
  str = str.replace(/^\s*/,'').replace(/\s*$/, '');
  return str; //º¯È¯ÇÑ ½ºÆ®¸µÀ» ¸®ÅÏ.
}

function getCookieVal(offset) {
  var endstr = document.cookie.indexOf(";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  var j = 0;
  while (i < clen) {
    j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal(j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}

function dayChk(yyStr, mmStr, ddStr) {
  var yy = Number(yyStr);
  var mm = Number(mmStr);
  var da = Number(ddStr);
  var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

  //À±³âÀÎ°¡¸¦ Ã¼Å©ÇÕ´Ï´Ù.
  if (((yy % 4 == 0) && (yy % 100 != 0)) || (yy % 400 == 0)) monarr[1] = 29;

  if (da <= monarr[mm - 1]) return true;
}

function $(obj)
{
	if(document.GetElementById)
		return document.GetElementById(obj);
	else
		return eval("document.all." + obj);
}

function wordCount(str, countView) {
  var x;
  var txt = str.value;
  txt = txt.replace(/\r\n/g, " ");
  var wordcounter = 0;
  if (txt.charAt(0) != " ") wordcounter = 1;
  for (x = 0; x < txt.length; x++) {
    if (txt.charAt(x) == " " && txt.charAt(x - 1) != " ") {wordcounter++;}
  }
  document.getElementById('wordcounter').innerHTML = wordcounter;
}

function wordWrap(txt, lineMax) {
  var x, xx;
  var str = txt.value;
  var tmpStr = "", tmpPara = "";
  var paraArr, wordArr;
  var lineCnt = 0;
  var nWordLen;

  while (str.indexOf("\r\n\r\n") >= 0) {
    str = str.replace(/\r\n\r\n/g, "\r\n");
  }
  paraArr = str.split("\r\n");

  for (xx = 0; xx < paraArr.length; xx++) {
    lineCnt = 0;
    tmpStr = "";
    while (paraArr[xx].indexOf("  ") >= 0) {
      paraArr[xx] = paraArr[xx].replace(/  /g, " ");
    }
    wordArr = paraArr[xx].split(" ");
    
    for (x = 0; x < wordArr.length - 1; x++) {
      tmpStr += wordArr[x];
      lineCnt += wordArr[x].length + 1;
      nWordLen = wordArr[x + 1].length;
      if ((lineCnt + nWordLen) > lineMax) {
        tmpStr += "\r\n";
        lineCnt = 0;
      } else {
        tmpStr += " ";
      }
    }
    tmpStr += wordArr[x];
    tmpPara += tmpStr + "\r\n";
  }
  tmpPara = tmpPara.substr(0, tmpPara.length - 2);

  txt.value = tmpPara;
}

//--> 
