// ÁÖ¹Îµî·Ï¹øÈ£ ´ÙÀ½À¸·Î ³Ñ¾î°¡±â
function next(str,order,size) {

   nex = order + 1;
   num = str.elements[order].value;
   siz = num.length;
   numFlag = Number(num);

   //alert('nex = ' + nex + ' \nnum = ' + num + '\nsiz = ' + siz + '\nnumFlag = ' + numFlag + '\norder = ' + order + '\nsize = ' + size);

   if(!numFlag && siz > 1 && num != '00' &&  num != '000'){
         alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
         str.elements[order].select();
         str.elements[order].focus();
         return false;
   }

   if(siz == size){
      if(order == 1) str.elements[nex].focus();
      return true;
   }

   if(order == 4 && siz == 1) {
        if(num < 1 || num > 4){
            alert('Àß¸øµÈ ÁÖ¹Î¹øÈ£ Çü½ÄÀÔ´Ï´Ù');
            str.elements[order].select();
            str.elements[order].focus();
            return false;
        }
   }
}

function ofix(sn, wn, w, h) { window.open(sn, wn,"WIDTH="+w+",HEIGHT="+h+",resizable=no,scrollbars=no"); }
function onofix(sn, wn, w, h) { window.open(sn, wn,"WIDTH="+w+",HEIGHT="+h+",resizable=yes,scrollbars=yes"); }
function movr(src,clrOver) 	{ if(!src.contains(event.fromElement))	{ src.bgColor = clrOver; } }
function mout(src,clrIn) { if (!src.contains(event.toElement)) 	{ src.style.cursor = 'default'; src.bgColor = clrIn;	} }
function Ngo(url) { location=url; }
function onofix_s(sn, wn, w, h) { window.open(sn, wn,"WIDTH="+w+",HEIGHT="+h+",resizable=no,scrollbars=yes"); }


function clickLayer(url,width,height) {
	var Xpoint, Ypoint;

	Xpoint = parseInt ( document.body.clientWidth / 2 - width / 2 );
	Ypoint = document.body.scrollTop + ( document.body.clientHeight / 2 ) - height/2 ;

	PopupLayer.style.visibility = 'hidden';
	PopupLayer.style.left   = Xpoint;
	PopupLayer.style.top    = Ypoint;
	PopupFrame.location=url;

	var iframeWin = window.frames['PopupFrame'];
	
	var iframeEl = window.document.getElementById? window.document.getElementById('PopupFrame'): document.all? document.all['PopupFrame']: null;
	
	if ( iframeEl && iframeWin )
	{
	  var docHt = height ; //getDocHeight(iframeWin.document);
	  var docWt = width ; //getDocHeight(iframeWin.document);
	
	  if (docHt != iframeEl.style.height) iframeEl.style.height = docHt + 'px';
	  if (docWt != iframeEl.style.height) iframeEl.style.width = docWt + 'px';
	}
	else
	{ // firefox
	  var docHt = window.document.getElementById('PopupFrame').contentDocument.height;
	  window.document.getElementById('PopupFrame').style.height = height + 'px';
	}	
	
	//PopupFrame.resizeTo(width,height);
	
	PopupLayer.style.visibility = 'visible';
}

function Layers() {
   var i, visStr, args, theObj;
   args = Layers.arguments;
   for (i=0; i<(args.length-2); i+=3) {
      visStr   = args[i+2];
      if (navigator.appName == 'Netscape' && document.layers != null) {
         theObj = eval(args[i]);
         if (theObj) theObj.visibility = visStr;
      } else if (document.all != null) {
         if (visStr == 'show') visStr = 'visible';
         if (visStr == 'hide') visStr = 'hidden';
         theObj = eval(args[i+1]);
         if (theObj) theObj.style.visibility = visStr;
      }
   }
}


function _clickLayer(url,width,height) {
	var Xpoint, Ypoint;

	Xpoint = parseInt ( document.body.clientWidth / 2 - width / 2 );
	Ypoint = document.body.scrollTop + ( document.body.clientHeight / 2 ) - height/2 ;

	PopupLayer.style.visibility = 'hidden';
	PopupLayer.style.left   = Xpoint;
	PopupLayer.style.top    = Ypoint;
	PopupFrame.location=url;
	
  var iframeWin = window.frames['PopupFrame'];

  var iframeEl = window.document.getElementById? window.document.getElementById('PopupFrame'): document.all? document.all['PopupFrame']: null;

  if ( iframeEl && iframeWin )
  {
    iframeEl.style.height = height + 'px';
    iframeEl.style.width = width + 'px';
  }
  else
  { // firefox
    window.document.getElementById('PopupFrame').style.height = height + 'px';
  }
  	
	//PopupFrame.resizeTo(width,height);
	PopupLayer.style.visibility = 'visible';
}

function clickLayer_pos(url,width,height,x,y) {
	var Xpoint, Ypoint;

	//Xpoint = parseInt ( document.body.clientWidth / 2 - width / 2 );
	//Ypoint = document.body.scrollTop + ( document.body.clientHeight / 2 ) - height/2 ;
	Xpoint = parseInt ( document.body.clientWidth / 2 - 400);
	PopupLayer.style.visibility = 'hidden';
	PopupLayer.style.left   = Xpoint+x;
	PopupLayer.style.top    = y;
	PopupFrame.location=url;

	var iframeWin = window.frames['PopupFrame'];
	
	var iframeEl = window.document.getElementById? window.document.getElementById('PopupFrame'): document.all? document.all['PopupFrame']: null;
	
	if ( iframeEl && iframeWin )
	{
	  var docHt = height ; //getDocHeight(iframeWin.document);
	  var docWt = width ; //getDocHeight(iframeWin.document);
	
	  if (docHt != iframeEl.style.height) iframeEl.style.height = docHt + 'px';
	  if (docWt != iframeEl.style.height) iframeEl.style.width = docWt + 'px';
	}
	else
	{ // firefox
	  var docHt = window.document.getElementById('PopupFrame').contentDocument.height;
	  window.document.getElementById('PopupFrame').style.height = height + 'px';
	}	
	
	//PopupFrame.resizeTo(width,height);
	
	PopupLayer.style.visibility = 'visible';
}

