/********************************************************************************************************
	ÀÌ¹ÌÁöÅø¹Ù Á¦°Å
********************************************************************************************************/
document.write("<meta http-equiv='imagetoolbar' content='no'>");


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*function autoblur() {
if(event.srcElement.tagName == "A") document.body.focus();
}
document.onfocusin = autoblur;*/

/********************************************************************************************************
	¸µÅ©½Ã Å¾È¿°ú
********************************************************************************************************/
function goTop(orix,oriy,desx,desy) {
		var Timer;
		var winHeight = document.body.scrollTop;
		if(Timer) clearTimeout(Timer);
		startx = 0;
		starty = winHeight;
		if(!orix || orix < 0) orix = 0;
		if(!oriy || oriy < 0) oriy = 0;
		var speed = 7;
		if(!desx) desx = 0 + startx;
		if(!desy) desy = 0 + starty;
		desx += (orix - startx) / speed;
		if (desx < 0) desx = 0;
		desy += (oriy - starty) / speed;
		if (desy < 0) desy = 0;
		var posX = Math.ceil(desx);
		var posY = Math.ceil(desy);
		window.scrollTo(posX, posY);
		if((Math.floor(Math.abs(startx - orix)) < 1) && (Math.floor(Math.abs(starty - oriy)) < 1)){
			clearTimeout(Timer);
			window.scroll(orix,oriy);
		}else if(posX != orix || posY != oriy){
			Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
		}else{
			clearTimeout(Timer);
		}
	}
	
	
	
/********************************************************************************************************
	¸µÅ©½Ã Æ÷Ä¿½º ¾ø¾Ö´Â ÇÔ¼ö
********************************************************************************************************/
function allblur() {
    for (i = 0; i < document.links.length; i++)
        document.links[i].onfocus = document.links[i].blur;
}
window.onload=allblur


/* ¹Ù·Î°¡±â ½ºÅ©¸³Æ® */
function go_to_station(stationform){
var MoveTo;    MoveTo=stationform.stationselect.selectedIndex;    
window.open(stationform.stationselect.options[MoveTo].value, target="_self");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function changeimage(towhat,url){
if (document.images){
document.images.targetimage.src=towhat.src
gotolink=url
}
}
function warp(){
window.location=gotolink
}








/********************************************************************************************************
	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 bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;








function onlyNumber() { 		
	if(((event.keyCode<48)||(event.keyCode>57))&&((event.keyCode<96)||(event.keyCode>105))&&(event.keyCode!=8)&&(event.keyCode!=9)&&(event.keyCode!=46)) event.returnValue = false;
}


/*****************************************************
* È¸¿øÃ¼Å© ½ºÅ©¸³Æ®
*****************************************************/
function userCheck(target){
	alert('È¸¿ø Àü¿ë ÆäÀÌÁöÀÔ´Ï´Ù. ·Î±×ÀÎÇØÁÖ¼¼¿ä.');
	if(target) location.target = target;
	parent.location.href = '/09_sub/01_sub.html';
}

/*****************************************************
* ¸ÞÀÎ°Ô½ÃÆÇ¹Ù·Î°¡±â
*****************************************************/
function viewContents(no,subpage,mcode){
	location.href=subpage+"?no="+no+mcode;
}


/*****************************************************
* ¸¶¿ì½º¿À¹ö »ö»óº¯°æ
*****************************************************/
function mouseOverColor(obj,bgColor,fontColor,cursor)
{
	obj.style.backgroundColor	= bgColor;
	obj.style.color				= fontColor;
	obj.style.cursor			= cursor;
}

function mouseOutColor(obj,bgColor,fontColor)
{
	obj.style.backgroundColor	= bgColor;
	obj.style.color				= fontColor;
}

/*****************************************************
* ·¹ÀÌ¾î ÆË¾÷Ã¢ °ü·Ã
*****************************************************/
function closeLayerPop(chk,no,opt) 
{ 
	if(chk.checked == true)
	{
		var today	= new Date();

		if(opt == 1)	var expire	= new Date(today.getTime() + (60*60*24*1000));
		else			var expire	= new Date(today.getTime() + (60*60*24*365*1000));

		setCookie("nsPopup_"+no,"yes",expire); 

		var obj = eval("	document.all['divpop"+no+"']");
		obj.style.visibility = "hidden"; 
		obj.style.display = "none"; 
	}
} 
function closeLayer(no){
	var obj = eval("	document.all['divpop"+no+"']");
	obj.style.visibility = "hidden"; 
	obj.style.display = "none"; 
}
function openLayer(no){
	var obj = eval("	document.all['divpop"+no+"']");
	obj.style.visibility = "visible"; 
	obj.style.display = ""; 
}
/*****************************************************/


/****************************************************
// ÆäÀÌÁö ·Îµù½Ã ½ÇÁ¦·Î ÆË¾÷¶ç¿ì´Â ÇÔ¼ö
*****************************************************/
function popupPage(popCnt)
{
	if(popCnt > 0)	openPop();
}

function openPop()
{
	for(i = 0 ; i < popObj.length ; i++)
	{
		if(!getCookie(popObj[i][3]))
		{
			window.open(popObj[i][0],popObj[i][1],popObj[i][2]);
		}
	}
}
/****************************************************
* ÄíÅ° ÀúÀå
*****************************************************/
// ½Ã°£Àº ºÐ´ÜÀ§
function setCookieVal (name, value, time) {
	pathname = location.pathname;
	var ExpDate = new Date();
  var myDomain = pathname.substring(0, pathname.lastIndexOf('/')) +'/';

	// ÀÌ·¸°Ô ¾µ¼öµµ ÀÖ´Ù.
  var myDomain = '/';

  ExpDate.setTime(ExpDate.getTime() + 1000*60* time);
  setCookie(name, value, ExpDate, myDomain);
}

function setCookie (name, value) {
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" :
			 ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

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;
	while (i < clen) {	//while open
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			 return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}	//while close
	return null;
}
/************************************************************************
* À¯È¿¼º Ã¼Å©
************************************************************************/
function checkNext() {
	if (document.form1.jumin1.value.length >= 6) {
		document.form1.jumin2.focus();
	}
}
// Àç¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å©
function check_fgnno(fgnno) {
        var sum=0;
        var odd=0;
        buf = new Array(13);
        for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
        odd = buf[7]*10 + buf[8];
        if(odd%2 != 0) { return false; }
        if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
                return false;
        }
        multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
        for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); }
        sum = 11 - (sum%11);
        if(sum >= 10) { sum -= 10; }
        sum += 2;
        if(sum >= 10) { sum -= 10; }
        if(sum != buf[12]) { return false }
        return true;
}
 
// ÁÖ¹Î¹øÈ£ Ã¼Å©
function check_juminno(juminno) {
        if(juminno=="" || juminno==null || juminno.length!=13) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Àû¾îÁÖ¼¼¿ä.");
                return false;
        }
        var jumin1 = juminno.substr(0,6);
        var jumin2 = juminno.substr(6,7);
        var yy         = jumin1.substr(0,2);        // ³âµµ
        var mm = jumin1.substr(2,2);        // ¿ù
        var dd = jumin1.substr(4,2);        // ÀÏ
        var genda = jumin2.substr(0,1);        // ¼ºº°
        var msg, ss, cc;
 
        // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
        if (!isNumeric(jumin1)) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ±æÀÌ°¡ 6ÀÌ ¾Æ´Ñ °æ¿ì
        if (jumin1.length != 6) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ±âº» ±¸¼º °Ë»ç
        if (yy < "00" || yy > "99" ||
                mm < "01" || mm > "12" ||
                dd < "01" || dd > "31") {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
        if (!isNumeric(jumin2)) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ±æÀÌ°¡ 7ÀÌ ¾Æ´Ñ °æ¿ì
        if (jumin2.length != 7) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ¼ºº°ºÎºÐÀÌ 1 ~ 4 °¡ ¾Æ´Ñ °æ¿ì
        if (genda < "1" || genda > "4") {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // ¿¬µµ °è»ê - 1 ¶Ç´Â 2: 1900³â´ë, 3 ¶Ç´Â 4: 2000³â´ë
        cc = (genda == "1" || genda == "2") ? "19" : "20";
        // Ã¹¹øÂ° ÀÚ·á¿¡¼­ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ³¯Â¥ Çü½Ä °Ë»ç
        if (isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false) {
                alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        // Check Digit °Ë»ç
        if (!isSSN(jumin1, jumin2)) {
                alert("ÀÔ·ÂÇÑ ÁÖ¹Îµî·Ï¹øÈ£¸¦ °ËÅäÇÑ ÈÄ, ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
                return false;
        }
        return true;
}
 
// »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å©
function check_busino(vencod) {
        var sum = 0;
        var getlist =new Array(10);
        var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
        for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); }
        for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
        sum = sum + parseInt((getlist[8]*5)/10);
        sidliy = sum % 10;
        sidchk = 0;
        if(sidliy != 0) { sidchk = 10 - sidliy; }
        else { sidchk = 0; }
        if(sidchk != getlist[9]) { return false; }
        return true;
}
 
 
function isYYYYMMDD(y, m, d) {
        switch (m) {
        case 2:        // 2¿ùÀÇ °æ¿ì
                if (d > 29) return false;
                if (d == 29) {
                        // 2¿ù 29ÀÇ °æ¿ì ´çÇØ°¡ À±³âÀÎÁö¸¦ È®ÀÎ
                        if ((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0))
                                return false;
                }
                break;
        case 4:        // ÀÛÀº ´ÞÀÇ °æ¿ì
        case 6:
        case 9:
        case 11:
                if (d == 31) return false;
        }
        // Å« ´ÞÀÇ °æ¿ì
        return true;
}
function isNumeric(s) {
        for (i=0; i<s.length; i++) {
                c = s.substr(i, 1);
                if (c < "0" || c > "9") return false;
        }
        return true;
}
function isLeapYear(y) {
        if (y < 100)
        y = y + 1900;
        if ( (y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0) ) {
                return true;
        } else {
                return false;
        }
}
function getNumberOfDate(yy, mm) {
        month = new Array(29,31,28,31,30,31,30,31,31,30,31,30,31);
        if (mm == 2 && isLeapYear(yy)) mm = 0;
        return month[mm];
}
function isSSN(s1, s2) {
        n = 2;
        sum = 0;
        for (i=0; i<s1.length; i++)
                sum += parseInt(s1.substr(i, 1)) * n++;
        for (i=0; i<s2.length-1; i++) {
                sum += parseInt(s2.substr(i, 1)) * n++;
                if (n == 10) n = 2;
        }
        c = 11 - sum % 11;
        if (c == 11) c = 1;
        if (c == 10) c = 0;
        if (c != parseInt(s2.substr(6, 1))) return false;
        else return true;
}
function email_check(str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1) return false;
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false;
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false;
	if (str.indexOf(at,(lat+1))!=-1) return false;
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false;
	if (str.indexOf(dot,(lat+2))==-1) return false;
	if (str.indexOf(" ")!=-1) return false;
	return true;
}

