function new_window2(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
	toolbar_str   = ( toolbar   == 'yes' ) ? 'yes' : 'no';
	menubar_str   = ( menubar   == 'yes' ) ? 'yes' : 'no';
	statusbar_str = ( statusbar == 'yes' ) ? 'yes' : 'no';
	scrollbar_str = ( scrollbar == 'yes' ) ? 'yes' : 'no';
	resizable_str = ( resizable == 'yes' ) ? 'yes' : 'no';
//alert( 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str );
	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 new_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) 
{ 
	toolbar_str   = 'no';
	menubar_str   = 'no';
	statusbar_str = 'no';
	scrollbar_str = 'no';
	resizable_str = 'no';
	window.open(url, name, 'left=0,top=0,width=600,height=426,toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function isNumeric( value )
{
	/*------------------------------------------------------------------*/
	/*  8 : BackSpace,		13 : Return			35 : End,				*/
	/* 36 : Home,			37 : ¡ç,			38 : ¡è,				*/
	/* 39 : ¡ç,				40 : ¡æ,			46 : . (Del),			*/
	/* 48 ~ 57 : 0 ~ 9,		96 ~ 105 : 0 ~ 9 (¼ýÀÚÆÐµå)					*/
	/*------------------------------------------------------------------*/
	if ( value == 8 || value == 9 || value == 13 || (value >= 35 && value <= 40) || value == 46 || (value >= 48 && value <= 57) || (value >= 96 && value <= 105) || value == 110 || value == 189 || value == 190 )
		 return true;
	else return false;
}

function FlashCall( value )
{
	document.write( value );
}

function setCookie( name, value, expires, domain)
{
	var path;
	var secure;
	path = "/";

	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expires );
	document.cookie = name + "=" + escape(value)
					+ ((path)    ? "; path=" + path                       : "")
					+ ((expires) ? "; expires=" + todayDate.toGMTString() : "")
					+ ((domain)  ? "; domain=" + domain                   : "")
					+ ((secure)  ? "; secure"                             : "");
}


function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie )
		{
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

function BillFrameReSize()
{
	var objBody = parent.document.frames("Bill").document.body;
	var objName = parent.document.all("Bill");

	var y = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);

//	if (y < 530) y = 530;
	if (y < 515) y = 515;

	objName.style.height = y;
}

/*----------------------------------------------------------------------*/
/* Á¤±Ô Ç¥Çö½Ä CHECK													*/
/*		/admin/userList.jsp, /admin/checkDuplicateID.jsp¿¡¼­ »ç¿ë		*/
/*----------------------------------------------------------------------*/
function patternMatching(field, rexp)
{
	if( !rexp.test(field) ) return false;
	else					return true;
}

//³¯Â¥ Ã¼Å©=========================================================================================================================
function ValidDate(source){
	var res,tmp_m,tmp_d, err;
	if (source.length == 8) {
		var kk = isNumber(source);
		if(kk){
			res = source.substring(0,4)+"-"+source.substring(4,6)+"-"+source.substring(6,8)
		} else {
			res = "";
			err = "Error";
		}
	}
	else if (source.length == 10) {
		var aa = isNumber(source.substring(0,4));
		var bb = isNumber(source.substring(5,7));
		var cc = isNumber(source.substring(8,10));
		if (aa && bb && cc) {
			res = source.substring(0,4)+"-"+source.substring(5,7)+"-"+source.substring(8,10)
		} else {
			res = "";
			err = "Error";
		}
	} 
	else if (((source.length > 0)&&(source.length < 8))||(source.length == 9)||(source.length > 10)) {
			res = "";
			err = "Error";
	}
	else {
			res = "";
			err = "";
	}


	 //¿©±â ºÎºÐÀº ³¯Â¥ ¿À·ù ¿©ºÎ¸¦ ÆÇ´ÜÇÏ´Â ºÎºÐÀÔ´Ï´Ù. °¢ ¿ù°ú ³¯Â¥¿¡ ´ëÇÑ string¸¦ Àß¶ó¼­ ºñ±³ÇÏ¿´½À´Ï´Ù.
	if (res.length == 10) {
		tmp_y = res.substring(0,4);
		tmp_m = res.substring(5,7);
		tmp_d = res.substring(8,10);
	//	 document.write(tmp);
		if ((tmp_m=="01"||tmp_m=="03"||tmp_m=="05"||tmp_m=="07"||tmp_m=="08"||tmp_m=="10"||tmp_m=="12")&&(tmp_d > "31")){
			err = "Error";
		}
		else if ((tmp_m=="04"||tmp_m=="06"||tmp_m=="09"||tmp_m=="11") && (tmp_d > "30")){
			err = "Error";
		}
		else if ((tmp_m=="02") && (tmp_d > "29")){
			err = "Error";
		}
		else if ((tmp_m<"01") || (tmp_m > "12")){
			err = "Error";
		}
		
		if  (err == "Error")   {
			alert("\n ³¯Â¥ ÀÔ·Â ¿À·ùÀÔ´Ï´Ù."+res+" \n ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÏ½Ê½Ã¿À. \n ¿¹1) 20040101   ¿¹2) 2004-01-01 \n");
			event.srcElement.focus();
			return("");
		}
		else {
			return(res);
		}
	}
	else {
		if  (err == "Error")   {
			alert("\n ³¯Â¥ ÀÔ·Â ¿À·ùÀÔ´Ï´Ù."+res+" \n ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÏ½Ê½Ã¿À. \n ¿¹1) 20040101   ¿¹2) 2004-01-01 \n");
			event.srcElement.focus();
			return("");
		}
		else {
			res = "";
			return(res);
		}
	}
}

//¼ýÀÚÀÔ·Â °ª¿¡ ´ëÇÑ Ã¼Å© ============================================================================================================
function isNumber(str){
   var i, ch;

   for (i=0;i<=str.length;i++) {
      ch = str.substr(i,1); 
   	if(!((ch >= 0) && (ch <= 9))){
         return(false); break;
	  	}
   }
   return(true);
}

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 loadFlash(filename,width,height,oMenu,oWmode){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ width +'" height="'+ height +'">');
document.write('<param name="movie" value="'+ filename +'"><param name="quality" value="high">');

if(oMenu)
	document.write('<param name="menu" value="false">');
if(oWmode)
	document.write('<PARAM NAME=wmode VALUE=transparent>');

document.write('<embed src="'+ filename +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'"></embed></object>');
}

// µ¿¿µ»ó Ãâ·Â ÇÔ¼ö
function loadMovie(filename,oName,oDisplay,oStatus,oControls,oAutoStart,oLoop,oVolume,oWidth,oHeight,oID){
document.write('<embed src="'+ filename +'" type="application/x-mplayer2" id="'+ oID +'" Name="'+ oName +'" ShowDisplay="'+ oDisplay +'" showstatusbar="'+ oStatus +'"');
document.write('showcontrols="'+ oControls +'" autostart="'+ oAutoStart +'" loop="'+ oLoop +'" volume="'+ oVolume +'"');
if(oWidth!="0")
	document.write(' width="'+ oWidth +'" height="'+ oHeight +'"');
document.write('>');
}

// ÆäÀÌÁö ³×ºñ°ÔÀÌ¼Ç ÀÌµ¿
function GoNextMove( next, page, board_id, name, code, arg )
{
	GoNext.action = next;
	GoNext.iCurrPage.value = page;
	GoNext.code.value = code;
	GoNext.arg.value = arg;

	GoNext.submit();
}
