/**
 * Copyright (c) 2000 by Fungrep co.,ltd
  * 
 * ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼ö
 *
 *
 * @version 1.1, 2007/10/06
 * @author jsc, help@fungrep.com
 */

/* »ç¿ë¹ý Start*/ 
//    var scroll    = new ScrollControl('html element id',options); 
// 
//    options Ç×¸ñ 
//    inteval : Àç±ÍÈ£Ãâ ½Ã°£ °£°Ý 1/1000ÃÊ(±âº»°ª 50) 
//    freeze : Àá½Ã ¸ØÃç ÀÖ´Â ½Ã°£ °£°Ý 1/1000 ÃÊ(±âº»°ª 1000) 
//    height : °´Ã¼ ³ôÀÌ(±âº»°ª 20) 
//    cMarginTop : ÀÚµ¿À¸·Î ±¸ÇØÁÖ³ª, ±ÛÀÚ Å©±â¿Í °´Ã¼ ³ôÀÌ µîÀ¸·Î ÀÎÇØ, ÀÇµµÇÑ ³ôÀÌ°¡ ³ª¿ÀÁö ¾ÊÀ» ¼ö ÀÖ±â ¶§¹®¿¡ »ç¿ëÀÚ°¡ °­Á¦ ÀÔ·ÂÇÔ. 
//     
/* »ç¿ë¹ý End */
/** 
* Author    : MC ½É»õ (ganer9r@naver.com) 
* Make Date : 2008-07-15 
* comment    : 1ÁÙ ÅØ½ºÆ® ·Ñ¸µ ½ºÅ©¸³Æ® 
**/ 
var ScrollControl    = function(objId,options){ 
    this.init(objId,options); 
} 
ScrollControl.prototype    = { 
    stage : {}, 
    options : {}, 
    isover : false, 
    freeze : false, 
    course : 'top', 

    init : function(objId,options){ 
        this.setOptions(options); 
        this.setStage(objId); 
        this.setTrueData(); 

        this.move(); 
    }, 
    setOptions : function(options){ 
        options.inteval    = options.inteval    || 50; 
        options.freeze    = options.freeze    || 1000; 
        options.height    = parseInt(options.height, 10)    || 20; 

        options.cMarginTop    = options.cMarginTop    || (options.height/2) * 0.3; 
        options.cHeight        = options.height - options.cMarginTop; 

        this.options    = options; 
    }, 
    setTrueData : function(){ 
        var cObjs        = this.stage.childNodes; 
        var removes        = []; 

        for(var i=0;i<cObjs.length;i++){ 
            if(!cObjs[i].tagName){ 
                removes.push(cObjs[i]);    //¹Ù·Î »èÁ¦ ½Ã µ¥ÀÌÅÍ ²¿ÀÌ´Âµí ÇÏ¿© ÀÏ´Ü ÅµÇÔ. 
            }else{ 
                cObjs[i].style.margin        = "0"; 

                cObjs[i].style.marginTop    = this.options.cMarginTop; 
                cObjs[i].style.height        = this.options.cHeight; 
            } 
        } 

        // Ã£Àº µ¥ÀÌÅÍ¸¦ »èÁ¦ÇÔ.(FFÀÇ °æ¿ì text ³ëµå°¡ Ã·ºÎµÊ.) 
        for(var i=0;i<removes.length;i++){ 
            this.stage.removeChild(removes[i]); 
        } 

        if(cObjs.length == 1){ 
            this.stage.appendChild( cObjs[0].cloneNode(true) ); 
        } 

    }, 
    setStage : function(objId){ 
        var This    = this; 
        this.stage        = document.getElementById(objId); 

        this.stage.style.height        = this.options.height; 
        this.stage.style.overflow    = "hidden"; 
        this.stage.style.padding    = "0px"; 
        this.stage.style.margin        = "0px"; 

        this.stage.onmouseover=function(){This.isover=true;} 
        this.stage.onmouseout=function(){This.isover=false;} 
    }, 
    setCourse : function(course){ 
        if(this.course != 'down' && course == 'down'){ 
            this.changeChild(); 
            this.stage.scrollTop = this.options.height; 
        }else if(course == 'top' && this.stage.scrollTop >= this.options.height){ 
            this.stage.appendChild(this.stage.childNodes[0]); 
            this.stage.scrollTop = this.stage.scrollTop - this.options.height; 
        } 

        this.course    = course; 
    }, 
    changeChild : function(){ 
        var childCnt    = this.stage.childNodes.length; 

        for(var i=0; i<childCnt-1;i++ ){ 
            this.stage.appendChild( this.stage.childNodes[0] );    // Ç×»ó Ã¹¹øÂ°°ÍÀ» µÚ·Î ÀÌµ¿ 
        } 
    }, 
    actionTop : function(){ 
        this.stage.scrollTop++; 
        if( this.stage.scrollTop >= this.options.height ){ 
            this.stage.appendChild(this.stage.childNodes[0]); 
            this.stage.scrollTop = this.stage.scrollTop - this.options.height; 
            this.freeze            = true; 
        } 
    }, 
    actionDown : function(){ 
        this.stage.scrollTop--; 
        if( this.stage.scrollTop == 0 ){ 
            this.changeChild(); 
            this.stage.scrollTop = this.options.height; 
            this.freeze            = true; 
             
            this.setCourse("top"); 
        } 
    }, 
    move : function(){ 
        if(!this.isover){ 
            if(this.course == 'top')    this.actionTop(); 
            else                        this.actionDown(); 
        } 

        var This    = this; 
        if(this.freeze)    window.setTimeout(function(){This.move()}, this.options.freeze); 
        else            window.setTimeout(function(){This.move()}, this.options.inteval); 
        this.freeze    = false; 
    } 
} 

function changeAvatar() {
	var url = '/personal/changeAvatar.jsp';
	var win = window.open(url,'avatar', 'scrollbars=no,toolbar=no,resizable=no,width=350, height=220,left=400,top=300');
	if (win == null) {
		alert('¾Æ¹ÙÅ¸ º¯°æÀ» À§ÇØ¼­ Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ¼¼¿ä');
	} else {
	 	win.focus();
  	}
}		

/* ·Î±× ¾Æ¿ô */
function logout(url) {
	if (url==null || url == '') url = '/';
	window.location.href ='/login/logout.jsp?url='+url;
}

/* ÆË¾÷À©µµ¿ì »çÀÌÁî ÀÚµ¿Á¶Àý */
function resizeWindow(scroll) {
	var w,h = 200;
	if (scroll==null || scroll == '' || scroll !='true') {
		w = document.body.scrollWidth +6;
		h = document.body.scrollHeight +25;
	} else {
 		w = document.body.scrollWidth +22;
		h = document.body.scrollHeight +25;
	}
	window.self.resizeTo(w,h);
}

/* ½Å±Ô°¡ÀÔ ÀÌº¥Æ® ¾È³» */
function newJoin() {
	if (confirm("Áö±Ý °¡ÀÔÇÏ¸é  ¸Â°í¸Ó´Ï 2Ãµ¸¸¿ø ¶Ç´Â Æ÷Ä¿¸Ó´Ï 1Ãµ¾ï¿øÀ» ¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù.\n\n Áö±Ý °¡ÀÔÇÏ¼¼¿ä.")) {
		window.location.href='/join/index.jsp';
	} 
}
	
/* ÀÌ¹ÌÁö Å©±â´ë·Î ¿­±â */
/* <a href="javascript:imgResize('¿øº»±×¸²ÁÖ¼Ò')"><img src="½æ³×ÀÏÁÖ¼Ò" /></a> */
function imgResize(img){ 
  img1= new Image(); 
  img1.src=(img); 
  imgControll(img); 
} 

function imgControll(img){ 
  if((img1.width!=0)&&(img1.height!=0)){ 
    viewImage(img); 
  } 
  else{ 
    controller="imgControll('"+img+"')"; 
    intervalID=setTimeout(controller,20); 
  } 
} 

function viewImage(img){ 
 W=img1.width+23; 
 H=img1.height; 
 O="width="+W+",height="+H+",scrollbars=yes"; 
 imgWin=window.open("","",O); 
 imgWin.document.write("<html><head><title> </title></head>");
 imgWin.document.write("<body topmargin=0 leftmargin=0>");
 imgWin.document.write("<img src="+img+" onclick='self.close()' style='cursor:hand;'>");
 imgWin.document.write("</body></html>");
 imgWin.document.close();
} 


/* °øÅë ¸Þ½ÃÁö Ã³¸® */
function msgLogin(url) {
	if (confirm ('·Î±×ÀÎ ÀÌÈÄ¿¡ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?')){
		window.location.href = '/login/loginform.jsp?url='+url;	
	}
}

/* document.domian = "tk.co.kr" */
/* ºñµ¿±â È£ÃâÇÏ±â */
function acall(url) { 
	var req;
	try {
		req = newXMLHttpRequest(); //request °´Ã¼ »ý¼º 
		req.open("POST", url, true); //POST¹æ½Ä Àü¼ÛÇÔ. 
		// req.open("GET", url, true); //GET¹æ½Ä Àü¼ÛÇÔ.
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");//¿äÃ»Çì´õÀÇ Á¤ÀÇ 
		req.send();
	} catch (e) {
	}
}
function newXMLHttpRequest() {
  var xmlreq = false; 
  if (window.XMLHttpRequest) { //ÆÄÀÌ¾îÆø½º³ª ¸ÆÀÇ »çÆÄ¸®ÀÇ °æ¿ìÃ³¸® 
    // Create XMLHttpRequest object in non-Microsoft browsers 
    xmlreq = new XMLHttpRequest(); 
  } else if (window.ActiveXObject) { //IE°è¿­ÀÇ ºê¶ó¿ìÁ®ÀÇ °æ¿ì 
    // Create XMLHttpRequest via MS ActiveX 
    try { 
      // Try to create XMLHttpRequest in later versions 
      // of Internet Explorer 
      xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e1) { 
      // Failed to create required ActiveXObject 
      try { 
        // Try version supported by older versions 
        // of Internet Explorer 
        xmlreq = new ActiveXObject("Microsoft.XMLHTTP"); 
      } catch (e2) { 
        // Unable to create an XMLHttpRequest with ActiveX 
      } 
    } 
  } 
  return xmlreq; 
}

/* ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ° ±ÝÁö */
function rightClick(){
  if((event.button==2) || (event.button==3)){
	;
  // alert('¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°À» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
 }
}
document.onmousedown=rightClick

/* »óÅÂÇ¥½ÃÁÙ ¾ø¾Ö±â */
function hidestatus() {
window.status='';
return true;
}
if (document.layers) document.captureEvents(Event.mouseover | Event.mouseout)
document.onmouseover=hidestatus
document.onmouseout=hidestatus

/* ÇÃ·¡½Ã¿¡ Å×µÎ¸® ¾ø¾Ö´Â ½ºÅ©¸³Æ® */
function removeFlashLine(id){
	document.write(id.text);id.id='';
}

/* ¹é±×¶ó¿îµå ÀÌ¹ÌÁö ¾ø¾Ö±â */
function clearbg(id){
	document.getElementById(id).style.backgroundImage='none';
}

function notReady() {
	alert("°ÔÀÓ¹° µî±ÞÀ§¿øÈ¸ µî±Þ½ÅÃ»Áß ÀÔ´Ï´Ù. \nµî±ÞºÐ·ù¸¦ ¸¶Ä¡´Â´ë·Î ¼­ºñ½ºÇÏ°Ú½À´Ï´Ù. \n°¨»çÇÕ´Ï´Ù.");
}
/* ÄíÅ°°ü·Ã ¸¸µé±â, ÀÐ±â, »èÁ¦ÇÏ±â */
function getCookie( name ) {
    var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
        return null;
    }
    if ( start == -1 ) return null;
    var end = document.cookie.indexOf( ';', len );
    if ( end == -1 ) end = document.cookie.length;
    return unescape( document.cookie.substring( len, end ) );
}

function setCookie( name, value, expires, path, domain, secure ) {
    var today = new Date();
    today.setTime( today.getTime() );
    if ( expires ) {
        expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date( today.getTime() + (expires) );
    document.cookie = name+'='+escape( value ) +
        ( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
        ( ( path ) ? ';path=' + path : '' ) +
        ( ( domain ) ? ';domain=' + domain : '' ) +
        ( ( secure ) ? ';secure' : '' );
}

function deleteCookie( name, path, domain ) {
    if ( getCookie( name ) ) document.cookie = name + '=' +
            ( ( path ) ? ';path=' + path : '') +
            ( ( domain ) ? ';domain=' + domain : '' ) +
            ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}

/* Áñ°ÜÃ£±â Ãß°¡ÇÏ±â */
function addFavorite () {
	var favoriteurl="http://www.tk.co.kr/" ;
	var favoritetitle="¢Æ°ÔÀÓÆ÷ÅÐ- Æ¼ÄÉÀÌ¢Æ" ;
	if (document.all) 
		window.external.AddFavorite(favoriteurl,favoritetitle);		
}

/*
 * iframe¿¡ Æ÷ÇÔµÈ ½ºÅ©·Ñ¹Ù ¾ø¾Ö±â
 */
function resizingFrame()
{
	var the_height= document.getElementById('theFrame').contentWindow.document.body.scrollHeight;
	document.getElementById('theFrame').height=the_height+50;
}
function autoResizeFrame()
{
	var obj;
	if(parent != null)
	{
		obj = parent.document.all[self.name];
		if(obj != null)
		{
			obj.style.pixelWidth = self.document.body.scrollWidth;
			obj.style.pixelHeight = self.document.body.scrollHeight;	
		}
	}
}
function resizeIFrame (iframeObj) {
	var innerBody = iframeObj.contentWindow.document.body;
	oldEvent = innerBody.onclick;
	innerBody.onclick = function(){resizeIFrame(iframeObj, 1);oldEvent;};
	var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
	iframeObj.style.height = innerHeight;
	var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
	iframeObj.style.width =innerWidth;
	if (!arguments[1]) this.scrollTo(1,1);
} 

/*
 * png ÆÄÀÏ Åõ¸í Ã³¸®ÇÏ±â
 * source by: http://jobdahan.net/homepage_Script/9071
 */
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 aboutTkash()
{
	 var url = '/include/aboutTkash.jsp';
	 open_win(url,'_tkash',430, 580);
}

/* »óÇ° ±¸¸ÅÇÏ±â */
/*
function go_buy(product_id)
{
	var url = 	'/shop/shopHandler.jsp?iid='+product_id+'&gid=&vStep=000&bVol=';
	open_win (url, '_goBuyForm', 430, 560);
}


function go_buy(product_id, gid)
{
	if (gid == null) gid = '';
	var url = 	'/shop/shopHandler.jsp?iid='+product_id+'&gid='+gid+'&vStep=000';
	open_win (url, '_goBuyForm', 430, 560);
}
*/

function go_buy(product_id, gid, vol)
{
	if (gid == null) gid = '';
	if (vol == null) vol = '';
	var url = 	'/shop/shopHandler.jsp?iid='+product_id+'&gid='+gid+'&vStep=000&bVol='+vol;
	open_win (url, '_goBuyForm', 430, 560);
}


/* »óÇ°±¸¸Å°¡´É¿©ºÎ °Ë»ç */
function go_buy_check() {
	var fvar = ''; 
	// dbgo ÇØ¿Ü°ÅÁÖÀÚ
	try {	
		fvar = eval(dbgo_state);
	} catch (e) {}
	if ( fvar!=null && fvar == 'E' ) 
		fvar = 'ÁË¼ÛÇÕ´Ï´Ù. ÇöÀç ÇØ¿Ü°ÅÁÖÀÚ´Â °áÁ¦ ¹× ¾ÆÀÌÅÛÀ» ±¸¸ÅÇÒ ¼ö ¾ø½À´Ï´Ù.'; 
	return fvar;
}
/*
	 var win = window.open('','_goBuyForm', 'scrollbars=auto,toolbar=no,resizable=yes,width=430,height=560,left=250,top=150'); 
	 // document.goBuyForm.iid.value=product_id;
	 document.goBuyForm.target='_goBuyForm';
	 document.goBuyForm.method='post';
	 document.goBuyForm.action='/shop/shopHandler.jsp';
	if (win == null) {
		alert('¾ÆÀÌÅÛ ±¸¸Å¸¦ À§ÇØ¼­´Â Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ¼¼¿ä');
	} else {
	 	document.goBuyForm.submit();
	 	win.focus();
	 }
*/
/*
	 // var url = '/shop/shopHandler.jsp?iid='+product_id+'&vStep=000';
	 open_win(url,'_shop',430, 560);	 
	 var win = window.open('/shop/shopHandler.jsp?iid='+product_id+'&vStep=000','_goBuyForm', 'scrollbars=auto,toolbar=no,resizable=yes,width=430,height=560,left=250,top=150');
	 // var url = '/shop/shopHandler.jsp?iid='+product_id+'&vStep=000';
	 open_win(url,'_shop',430, 560);
*/


/* ºÎ¸ð À©µµ¿ì reload & ÀÚ½ÄÀ©µµ¿ì´Ý±â */
function reloadClose()
{
	// parent.opener.document.location.reload();
	opener.document.location.reload();
	self.close();
}

 
/* ¾ÆÀÌÅÛ »ç¿ëÇÏ±â */
function useItem (v,i){
	 var url = '/shop/use_item.jsp?inv='+v+'&iid='+i;
	 open_win(url,'_shop',430, 420);
}

/* ¾ÆÀÌÅÛ »ç¿ëÇÏ±â */
function releaseItem (v,i){
	 var url = '/shop/release_item.jsp?inv='+v+'&iid='+i;
	 open_win(url,'_shop',430, 420);
}

/* ¾ÆÀÌÅÛ ¼±¹°ÇÏ±â */
function giftItem (v,i){
	 var url = '/shop/gift_item.jsp?inv='+v+'&iid='+i;
	 open_win(url,'_shop',430, 560);
}

function openMessage (m,to){
	// m=(r, ÀÐ±â), (w,¾²±â), (s, ÀúÀå)
	 var url = ''; /* '/include/msg_box_write.jsp';*/
	 if (m == null || m == '' || m=='r') url  = '/include/msg_box.jsp';
	 else if (m=='w') url  = '/include/msg_box_write.jsp?to='+to;
	 else url = '/include/msg_box.jsp';	 
	 open_win(url,'_msg',430, 600);
}

/* À©µµ¿ì ´Ý°í, ÀÎº¥Åä¸® ÆäÀÌÁö·Î °¡±â */
function goInvent(){
	opener.location.href="/personal/index.jsp?p=item&c=1";
	self.close();
}
function goTkash(){
	opener.location.href="/personal/index.jsp?p=buy";
	self.close();
}

function open_win (urlstr, name, w, h) {
   var left = '';   
   var top = '';
   var win = null;
   if (window.screen.width < 1025) {
   	left = '';
   	top = '';
   } else {
	   left = (typeof(w) != 'undefined') ? ',left=' + ((window.screen.availWidth-w)*0.5) : ',left=250';           
	   top = (typeof(h) != 'undefined') ? ',top=' + ((window.screen.availHeight-h)*0.4) : ',top=150';
	}         
	win = window.open(urlstr, name , 'scrollbars=auto,toolbar=no,resizable=yes,width='+w+',height='+h + left + top);
	if (win == null) {
		alert('»çÀÌÆ® ÀÌ¿ëÀ» À§ÇØ¼­ Â÷´ÜµÈ ÆË¾÷Ã¢À» Çã¿ëÇØ ÁÖ¼¼¿ä');
	} else {
	 	win.focus();
   }
}

function openWindow (urlstr) {
	window.open(urlstr, '_tkgaming', 'scrollbars=yes,toolbar=no,resizable=no,width=680,height=700,left=250,top=150');
}


/*
ÁÖ¹Î¹øÈ£,¿Ü±¹ÀÎ¹øÈ£,»ç¾÷ÀÚ¹øÈ£ Ã¼Å© Script 

1. ÁÖ¹Îµî·Ï¹øÈ£
2. Àç¿Ü±¹ÀÎ µî·Ï¹øÈ£
3. »ç¾÷ÀÚµî·Ï¹øÈ£

µîÀÇ ÁøÀ§ ¿©ºÎ¸¦ Ã¼Å©ÇÒ ¼ö ÀÖ´Â JavaScriptÀÔ´Ï´Ù.
(Á¤ÅëºÎ(?)¿¡¼­ °ø°³µÇ¾îÀÖ´ø ½ºÅ©¸³Æ®ÀÏ°Ì´Ï´Ù...)

»ç¿ë¹ýÀº
check_fgnno('¿Ü±¹ÀÎ¹øÈ£13ÀÚ¸®');
check_juminno('ÁÖ¹Î¹øÈ£13ÀÚ¸®');
check_busino('»ç¾÷ÀÚ¹øÈ£10ÀÚ¸®');
*/
<!--
// Àç¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å©
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;
}

/**
 * Copyright (c) 2000 by Fungrep co.,ltd
  * 
 * ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼ö
 *
 * ÁÖÀÇ: ¾Æ·¡ÀÇ ¸ðµç ¸Þ¼Òµå´Â ÀÔ·ÂÆûÀÇ ÇÊµåÀÌ¸§(myform.myfield)À»
 *       ÆÄ¶ó¹ÌÅÍ·Î ¹Þ´Â´Ù. ÇÊµåÀÇ °ª(myform.myfield.value)ÀÌ ¾Æ´ÔÀ»
 *       À¯³äÇÒ °Í.
 */
 
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;
}

/**
 * 
 * ÀÚ¹Ù½ºÅ©¸³Æ® °øÅëÇÔ¼ö
 *
 * ÁÖÀÇ: ¾Æ·¡ÀÇ ¸ðµç ¸Þ¼Òµå´Â ÀÔ·ÂÆûÀÇ ÇÊµåÀÌ¸§(myform.myfield)À»
 *       ÆÄ¶ó¹ÌÅÍ·Î ¹Þ´Â´Ù. ÇÊµåÀÇ °ª(myform.myfield.value)ÀÌ ¾Æ´ÔÀ»
 *       À¯³äÇÒ °Í.
 */


/**
 * ÀÔ·Â°ªÀÌ NULLÀÎÁö Ã¼Å©
 */
function isNull(input) {
    if (input.value == null || input.value == "") {
        return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ª¿¡ ½ºÆäÀÌ½º ÀÌ¿ÜÀÇ ÀÇ¹ÌÀÖ´Â °ªÀÌ ÀÖ´ÂÁö Ã¼Å©
 */
function isEmpty(input) {
    if (input.value == null || input.value.replace(/ /gi,"") == "") {
        return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ª¿¡ Æ¯Á¤ ¹®ÀÚ(chars)°¡ ÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¦ Çã¿ëÇÏÁö ¾ÊÀ¸·Á ÇÒ ¶§ »ç¿ë
 * ex) if (containsChars(form.name,"!,*&^%$#@~;")) {
 *         alert("ÀÌ¸§ ÇÊµå¿¡´Â Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
 *     }
 */
function containsChars(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) != -1)
           return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *         alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
 *     }
 */
function containsCharsOnly(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) == -1)
           return false;
    }
    return true;
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºªÀÎÁö Ã¼Å©
 * ¾Æ·¡ isAlphabet() ºÎÅÍ isNumComma()±îÁöÀÇ ¸Þ¼Òµå°¡
 * ÀÚÁÖ ¾²ÀÌ´Â °æ¿ì¿¡´Â var chars º¯¼ö¸¦ 
 * global º¯¼ö·Î ¼±¾ðÇÏ°í »ç¿ëÇÏµµ·Ï ÇÑ´Ù.
 * ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 *     var lowercase = "abcdefghijklmnopqrstuvwxyz"; 
 *     var number    = "0123456789";
 *     function isAlphaNum(input) {
 *         var chars = uppercase + lowercase + number;
 *         return containsCharsOnly(input,chars);
 *     }
 */
function isAlphabet(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

function isUserid(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚÀÎÁö Ã¼Å©
 */
function isUpperCase(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ¼Ò¹®ÀÚÀÎÁö Ã¼Å©
 */
function isLowerCase(input) {
    var chars = "abcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
 */
function isNumber(input) {
    var chars = "0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª,¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,´ë½Ã(-)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumDash(input) {
    var chars = "-0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,ÄÞ¸¶(,)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumComma(input) {
    var chars = ",0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ª¿¡¼­ ÄÞ¸¶¸¦ ¾ø¾Ø´Ù.
 */
function removeComma(input) {
    return input.value.replace(/,/gi,"");
}

/**
 * ÀÔ·Â°ªÀÌ »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ Æ÷¸Ë Çü½ÄÀÎÁö Ã¼Å©
 * ÀÚ¼¼ÇÑ format Çü½ÄÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ 'regular expression'À» ÂüÁ¶
 */
function isValidFormat(input,format) {
    if (input.value.search(format) != -1) {
        return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö Ã¼Å©
 */
function isValidEmail(input) {
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
//    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
//    return isValidFormat(input,format);
   var format = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;    
	return format.test(input.value);
}

/**
 * ÀÔ·Â°ªÀÌ ÀüÈ­¹øÈ£ Çü½Ä(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö Ã¼Å©
 */
function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}

/**
 * ¼±ÅÃµÈ ¶óµð¿À¹öÆ°ÀÌ ÀÖ´ÂÁö Ã¼Å©
 */
function hasCheckedRadio(input) {
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) return true;
        }
    } else {
        if (input.checked) return true;
    }
    return false;
}

/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ÀÖ´ÂÁö Ã¼Å©
 */
function hasCheckedBox(input) {
    return hasCheckedRadio(input);
}

function getRadioValue (input) {
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) return input[inx].value;
        }
    } else {
        if (input.checked) return input.value;
    }
    return '';
}


/**
 * ÀÔ·Â°ªÀÇ ¹ÙÀÌÆ® ±æÀÌ¸¦ ¸®ÅÏ
 * Author : Wonyoung Lee
 */
function getByteLength(input) {
    var byteLength = 0;
    for (var inx = 0; inx < input.value.length; inx++) {
        var oneChar = escape(input.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }
    return byteLength;
}

/*
 * ¼ýÀÚ¿¡ ÄÞ¸¶³Ö±âÇÔ¼ö.
 * ¿¹) ÀÔ·Â123123 =>  Ãâ·Â: 123,123
 *
 */
function addComma (num) {
	var formatNum = '';
	if (num.length > 3) {
		var str1 = num.substring(0, num.length%3);
		var str2 = num.substring(num.length%3, num.length);
		
		if (str1.length != 0) str1 += ",";
		formatNum += str1;
		
		for (var i=0; i<str2.length; i++) {
		if (i%3 == 0 && i != 0) formatNum += ",";
		formatNum += str2.charAt(i);
		}
	} else {
		formatNum = num;
	}
	return formatNum;
}

/*
  * ºÎÃ¤Áú À©µµ¿ì¿ÀÇÂ
*/
function pu_login(url,target,w,h,scroll) 
{ 
 var win= null; 
 var winl = (screen.width-w)/2; 
 var wint = (screen.height-h)/2; 
 var settings  ='height='+h+','; 
  settings +='width='+w+','; 
  settings +='top='+wint+','; 
  settings +='left='+winl+','; 
  settings +='scrollbars='+scroll+','; 
  settings +='resizable=no'; 
 win=window.open(url,target,settings); 
 win.window.focus(); 
}

 
/*
	ÅØ½ºÆ® ¹Ú½º ±æÀÌ°¡ x ÀÌ¸é ´ÙÀ½À¸·Î ÀÌµ¿ÇÏ±â
	@Usage :	<input type="text" onkeyup="focus_move(4,this,document.wowcoin.TEL3);" />
*/
function focus_move(len,obj1,obj2) {	
	var key	= event.keyCode;
	var flag = 0;
	if (key != 9 && key != 16) {
		flag	= obj1.value.length;
		if (flag==len) {
			obj2.focus();
		}
	}
}

/* Æ¯Á¤ URL °¡±â */
function go(u) {
	window.location.href = u;
}