<!--
//·Ñ¿À¹ö
function restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function preload_img()
{ 
  var img_list = preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}
//new À©µµ¿ì
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//·Ñ¿À¹ö
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_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_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];}
}

//top
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getSty(id) {
	x = getRef(id);
	return (isNS4 ? getRef(id) : getRef(id).style);
}

var scrollerHeight = 200;
var puaseBetweenImages = 3000;
var imageIdx = 0;

function moveRightEdge() {
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;

	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 500;   // À§ÂÊ À§Ä¡
	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 550; // À§ÂÊ À§Ä¡
	}
	timeoutNextCheck = 500;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}


function numCheck(target)
{  var Digit = '1234567890';
   for (i=0 ;i<=target.length ;i++)
   {  if(Digit.indexOf(target.substring(i,i+1)) < 0) 
      {  
   return true;
      }
   }
   return false;
}

var special_char = " `~!@#$%^&*()_-+=|\\[]{}:;,<.>/?'\"";
var temp = "";
function identify(ident) {
 for ( var i = 0 ; i < special_char.length ; i++ ) {
  temp = special_char.substr(i, 1); 
  if ( ident.indexOf(temp) != -1 ) return true ;
 }
 return false;
}

var addr_special_char = "`~!@#$%^&*_+=|\\[]{}:;,<.>/?'\"";
var temp1 = "";
function addr_identify(ident) {
 for ( var i = 0 ; i < addr_special_char.length ; i++ ) {
  temp1 = addr_special_char.substr(i, 1); 
  if ( ident.indexOf(temp1) != -1 ) return true ;
 }
 return false;
}

var email_special_char = " `~!#$%^&*()+=|\\[]{}:;,<>/?'\"";
var temp2 = "";
function email_identify(ident) {
 for ( var i = 0 ; i < email_identify.length-3; i++ ) {
  temp2 = email_special_char.substr(i,1);
  if ( ident.indexOf(temp2) != -1 ) return true;
 }
 return false;
}

function social_id_check(f) {
	jumin = mregform.m_num1.value+mregform.m_num2.value;

	if(Jumin_chk(jumin)) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ Àß¸ø ±âÀÔµÇ¾ú½À´Ï´Ù.\n\n´Ù½Ã È®ÀÎÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		return true;
	} 
	return false;
}

function email_chk(t)
{
	var ValidFlag = false
	var atCount = 0
	var SpecialFlag
	var atLoop
	var atChr
	var BadFlag
	var tAry1
	var UserName
	var DomainName

	if ( t.length > 0 && t.indexOf("@") > 0 && t.indexOf(".") > 0 ) {
		atCount = 0
		SpecialFlag = false

		for( atLoop=1; atLoop<=t.length; atLoop++ ) {
			atChr = t.substring( atLoop, atLoop+1 )
			if ( atChr == "@" ) atCount = atCount + 1
			
			if ( (atChr >= 32) && (atChr <= 44) ) SpecialFlag = true 
			if ( (atChr == 47) || (atChr == 96) || (atChr >= 123) ) SpecialFlag = true 
			if ( (atChr >= 58) && (atChr <= 63) ) SpecialFlag = true 
			if ( (atChr >= 91) && (atChr <= 94) ) SpecialFlag = true 
		}
			
		if ( ( atCount == 1 ) && (SpecialFlag == false ) ) {
			BadFlag = false
			tAry1 = t.split("@")
			UserName = tAry1[0]
			DomainName = tAry1[1]
			if ( (UserName.length <= 0 ) || (DomainName.length <= 0 ) ) BadFlag = true
			if ( DomainName.substring( 1, 2 ) == "." ) BadFlag = true
			if ( DomainName.substring( DomainName.length-1, DomainName.length) == "." ) BadFlag = true
			ValidFlag = true
		}
	}
	if ( BadFlag == true ) ValidFlag = false
	return ValidFlag

}

function Jumin_chk(it) {
	IDtot = 0;
	IDAdd = "234567892345";

	for(i=0; i<12; i++) IDtot = IDtot + parseInt(it.substring(i, i+1)) * parseInt(IDAdd.substring(i, i+1));
		IDtot = 11 - (IDtot%11);
	if (IDtot == 10) IDtot = 0;

	else if (IDtot == 11) IDtot = 1;
	
	if(parseInt(it.substring(12, 13)) != IDtot) return true;
	
	else return false
} 

function IDCheck(t)
{
	var id = t.value;
    var  id_check = "";
    var temp6 = "";
	if (id.length < 4 || id.length > 20)
	{
		t.focus();
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À. (4~20ÀÚ).");
	}
	else
		window.open("id_check.asp?id=" + id,"¾ÆÀÌµðÁßº¹°Ë»ç","width=420 height=226,top=200,left=200,scrollbars=no,resizable=no");
}

function zipcode()
{
    window.open('/member/post.asp','', 'width=420, height=226,left=200,top=200, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no, copyhistory=no')
}

function mouseOnMETD(seq, bool)
{
	var oTD = eval("document.all.menu" + seq);
	var borderStyle = "1 solid ";
	
	if (bool){
			oTD.style.border = borderStyle+" #FFFFFF";
			oTD.style.cursor = "hand";
			oTD.style.backgroundColor = "#3165CE";
		
	}else{
			oTD.style.border = borderStyle+" #00309C";
			oTD.style.cursor = "default";
			oTD.style.backgroundColor = "#00309C";
	}
}

function mouseOnSMETD(seq, bool)
{
	var oTD = eval("document.all.smenu" + seq);
	var borderStyle = "1 solid ";
	
	if (bool){
			oTD.style.border = borderStyle+" #F7F3F7";
			oTD.style.cursor = "hand";
			oTD.style.backgroundColor = "#F7F3F7";
			oTD.style.color="#333333";
		
	}else{
			oTD.style.border = borderStyle+" #F7F3F7";
			oTD.style.cursor = "default";
			oTD.style.backgroundColor = "#ffffff";
			oTD.style.color="#333333";
	}
}

function mouseOnSSMETD(seq, bool)
{
	var oTD = eval("document.all.ssmenu" + seq);
	var borderStyle = "1 solid ";
	
	if (bool){
			oTD.style.border = borderStyle+" #cccccc";
			oTD.style.cursor = "hand";
			oTD.style.backgroundColor = "#eeeeee";
		
	}else{
			oTD.style.border = borderStyle+" #FFFFFF";
			oTD.style.cursor = "default";
			oTD.style.backgroundColor = "#ffffff";
	}
}

function mouseOnSSSMETD(seq, bool)
{
	var oTD = eval("document.all.date_bg" + seq);
	
	if (bool){
			oTD.style.cursor = "hand";
			oTD.style.backgroundColor = "#EEF4F9";
			oTD.style.color="#0033CC";
		
	}else{
			oTD.style.cursor = "default";
			oTD.style.backgroundColor = "";
			oTD.style.color="";
	}
}

function getObj(obj) 
{ 
var nscp = (navigator.appName == "Netscape") 
var ismc = (navigator.appVersion.indexOf("Mac") != -1) 
var vers = parseFloat(navigator.appVersion.substring(22,25)) 

   if (nscp) 
   { 
    compLayr = document.layers[obj] 
   }
   else
   { 
    compLayr = eval("document.all." + obj + ".style") 
   } 
    return compLayr 
}

function menugo(url){
	location.href=url;
}

function _ID(obj){return document.getElementById(obj)}

function iciScroll(obj) {
	if (event.wheelDelta >= 120) obj.scrollTop -= 40;
	else if (event.wheelDelta <= -120) obj.scrollTop += 40;
	return false;
}


function chkLength(field,len) {
	text = field.value;
	if (text.trim().length<len){
		alert(len + "ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù");
		field.focus();
		return false;
	}
	return true;
}

function chkPatten(field,patten,msg)
{
	var regNum			= /^[0-9]+$/;
	var regEmail		= /^[_a-zA-Z0-9-]+@[._a-zA-Z0-9-]+\.[a-zA-Z]+$/;
	var regUrl			= /^(http\:\/\/)*[.a-zA-Z0-9-]+\.[a-zA-Z]+$/;
	var regAlpha		= /^[a-zA-Z]+$/;
	var regHangul		= /[°¡-ÆR]/;
	var regHangulEng	= /[°¡-ÆRa-zA-Z]/;
	var regHangulOnly	= /^[°¡-ÆR]*$/;
	var regId			= /^[a-zA-Z0-9]{1}[a-zA-Z0-9_-]{3,9}$/;
	var regPass			= /^[a-zA-Z0-9_-]{4,12}$/;

	patten = eval(patten);
	if (!patten.test(field.value)){
		if (!field.getAttribute("label")) field.getAttribute("label") = field.name;
		var msg2 = "[" + field.getAttribute("label") + "] ÀÔ·ÂÇü½Ä¿À·ù";
		if (msg) msg2 += "\n\n" + msg;
		alert(msg2);
		field.focus();
		return false;
	}
	return true;
}

function formOnly(form){
	var i,idx = 0;
	var rForm = document.getElementsByTagName("form");
	for (i=0;i<rForm.length;i++) if (rForm[i].name==form.name) idx++;
	return (idx==1) ? form : form[0];
}


// ¼ýÀÚ Ç¥½Ã (3ÀÚ¸®¸¶´Ù ÄÞ¸¶Âï±â)
function num_check() {
        // ie¿¡¼­¸¸ ÀÛµ¿
        var keyCode = event.keyCode
        if (keyCode < 48 || keyCode > 57){
                alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù."+"["+keyCode+"]")
                event.returnValue=false
        }
}

function FormatNumber2(num){
        fl=""
        if(isNaN(num)) { alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");return 0}
        if(num==0) return num
        
        if(num<0){ 
                num=num*(-1)
                fl="-"
        }else{
                num=num*1 //Ã³À½ ÀÔ·Â°ªÀÌ 0ºÎÅÍ ½ÃÀÛÇÒ¶§ ÀÌ°ÍÀ» Á¦°ÅÇÑ´Ù.
        }
        num = new String(num)
        temp=""
        co=3
        num_len=num.length
        while (num_len>0){
                num_len=num_len-co
                if(num_len<0){co=num_len+co;num_len=0}
                temp=","+num.substr(num_len,co)+temp
        }
        return fl+temp.substr(1)
}

function FormatNumber3(num){
        num=new String(num)
        num=num.replace(/,/gi,"")
        return FormatNumber2(num)
}

/**
 * tab(El)
 *
 * textarea ÀÔ·Â ¹Ú½º¿¡¼­ tabÅ°·Î °ø¹é ¶ç¿ì±â ±â´É Ãß°¡
 *
 * @Usage	<textarea onkeydown="return tab(this)"></textarea>
 */

function tab(El)
{
	if ((document.all)&&(event.keyCode==9)){
		El.selection = document.selection.createRange();
		document.all[El.name].selection.text = String.fromCharCode(9)
		document.all[El.name].focus();
		return false;
	}
}

function enter()
{
    if (event.keyCode == 13){
        if (event.shiftKey == false){
            var sel = document.selection.createRange();
            sel.pasteHTML('<br>');
            event.cancelBubble = true;
            event.returnValue = false;
            sel.select();
            return false;
        } else {
            return event.keyCode = 13;
		}
    }
}

/**
 * ¹®ÀÚ¿­ ÀÚ¸£±â (ÇÑ±Û 2byte)
 */
function strCut(str, max_length)
{
	var str, msg;
	var length = 0;
	var tmp;
	var count = 0;
	length = str.length;

	for (var i = 0; i < length; i++){
		tmp = str.charAt(i);
		if(escape(tmp).length > 4) count += 2;
		else if(escape(tmp) != "%0D") count++;
		if(count > max_length) break;		
	}
	return str.substring(0, i);
}

function onlynumber()
{
	var e = event.keyCode;
	window.status = e;
	if (e>=48 && e<=57) return;
	if (e>=96 && e<=105) return;
	if (e>=37 && e<=40) return;
	if (e==8 || e==13 || e==46) return;
	event.returnValue = false;
}







