//----------------------------------- ÇÊµå(String) ³»¿ë °ü·Ã ÇÔ¼ö  -----------------------------------
 
/******************************
*  ±â´É :  ¹®ÀÚ¿­ Valid °Ë»çÃ³¸® *
*  ¼öÁ¤ÀÏ : 2002-01-25              *
*  parameter : string, space  *
*******************************/

function CheckValid(String, space)
{

   var retvalue = false;

   for (var i=0; i<String.length; i++)
   {		//StringÀÌ 0("" ÀÌ³ª null)ÀÌ¸é ¹«Á¶°Ç false
      if (space == true)
      {
         if (String.charAt(i) == ' ')
         {			//StringÀÌ 0ÀÌ ¾Æ´Ò¶§ space°¡ ÀÖ¾î¾ß¸¸ true(valid)
            retvalue = true;
            break;
         }
      } else {
         if (String.charAt(i) != ' ')
         {			//stringÀÌ 0ÀÌ ¾Æ´Ò¶§ space°¡ ¾Æ´Ñ ±ÛÀÚ°¡ ÀÖ¾î¾ß¸¸ true(valid)
            retvalue = true;
            break;
         }
      }
   }

   return retvalue;
}

/******************************
*  ±â´É :  Empty ¹× °ø¹é Ã³¸®    *
*  ¼öÁ¤ÀÏ : 2002-01-25              *
*  parameter : field, error_msg  *
*******************************/

function isEmpty(field, error_msg)
{
	// error_msg°¡ ""ÀÌ¸é alert¿Í focusingÀ» ÇÏÁö ¾Ê´Â´Ù
	if(error_msg == "") {
		if(!CheckValid(field.value, false)) 	{
			return true;
		} else {
			return false;
		}
	} else {
		if(!CheckValid(field.value, false)) {
			alert(error_msg);
			field.focus() ;
			return true;
		} else {
			return false;
		}
	}
}

function isNotSet(field, error_msg)
{ 
	//for hidden field....
	if(field.value == "")
	{
		alert(error_msg);
		return true;
	} else
	{
		return false;
	}
}

function haveSpace(field, error_msg)
{
	if(CheckValid(field.value, true))
	{
		alert(error_msg);
		field.focus();
		field.select();
		return true;
	}
	return false;
}


/******************************
*  ±â´É :  NumberCheck           *
*  ¼öÁ¤ÀÏ : 2002-03-29(denial)              *
*  parameter : field, error_msg  *
*******************************/
function isNotNumber(field, error_msg)
{
	var val = field.value;

	if(isNaN(val) ) {
		if(error_msg.length > 0) {
			alert(error_msg);
			field.focus();
			field.select();
		}
		return true;
	} else {
		return false;
	}
}

/******************************
*  ±â´É :  NumberCheck And Empty Check
*  ¼öÁ¤ÀÏ : 2002-04-02(denial)
*  parameter : field, error_msg
*******************************/
function isNotNumberOrEmpty(field, error_msg)
{
	var val = field.value;

	if(val.length == 0 || isNaN(val) ) {
		if(error_msg.length > 0) {
			alert(error_msg);
			field.focus();
			field.select();
		}
		return true;
	} else {
		return false;
	}
}

function alertAndFocus(field, error_msg)
{
	alert(error_msg);
	field.focus();
	field.select();
}

/***************************************
*  ±â´É : String ¾ËÆÄºª°ú ¼ýÀÚ¸¸~ Check  *
*  ¼öÁ¤ÀÏ : 2002-01-25                           *
*  parameter : Form                              *
****************************************/
function isNotAlphaNumeric(field,error_msg)
{

   for (var i=0; i < field.value.length; i++)
   {
      if ( ( (field.value.charAt(i) < "0") || (field.value.charAt(i) > "9") ) &&
           ( ( (field.value.charAt(i) < "A") || (field.value.charAt(i) > "Z") ) &&
             ( (field.value.charAt(i) < "a") || (field.value.charAt(i) > "z") ) ) )
	  {
         alert(error_msg);
		 field.focus();
		 field.select();
		 return true;
	   }
   }

   return false;
}

// ÇÊµå(String) ±æÀÌ °ü·Ã
function strLength(field)
{

   var Length = 0;

   var Nav = navigator.appName;
   var Ver = navigator.appVersion;

   var IsExplorer = false;

   var ch;

   if ( (Nav == 'Microsoft Internet Explorer') && (Ver.charAt(0) >= 4) )
   {
      IsExplorer = true;
   }

   if(IsExplorer)
   {

      for(var i = 0 ; i < field.value.length; i++)
      {

         ch = field.value.charAt(i);

         if ((ch == "\n") || ((ch >= "¤¿") && (ch <= "È÷")) ||
             ((ch >="¤¡") && (ch <="¤¾")))
		{
	    	Length += 2;
		} else
		{
	    	Length += 1;
       	}

	  }

   }else {
      Length = field.value.length ;
   }

   return Length;
}

/****************************************
*  ±â´É : ¹®ÀÚ¿­ ±æÀÌÁ¦ÇÑ                          *
*  ¼öÁ¤ÀÏ : 2002-01-25                              *
*  parameter : field, min, max, error_msg  *
*****************************************/
function isOutOfRange(field, min, max, error_msg)
{
	if(strLength(field) < min || strLength(field) > max)
	{
		alert(error_msg);
		field.focus();
		field.select();
		return true;
	}
	return false;
}

function isNotExactLength(field, len, error_msg) {
	if(strLength(field) != len) {
		alert(error_msg);
		field.focus();
		field.select();
		return true;
	}
	return false;
}

function isOutOfNumericRange(field, min, max, error_msg) {
	if(field.value < min || field.value > max) {
		alert(error_msg);
		field.focus();
		field.select();
		return true;
	}
	return false;
}
//---------------//


//------------------------------------- SELECT, CHECK BOX °ü·Ã ÇÔ¼ö -------------------------------
/****************************************
*  ±â´É :  Select Box ¼±ÅÃ¿©ºÎ °Ë»ç            *
*  ¼öÁ¤ÀÏ : 2002-01-25                              *
*  parameter : field, error_msg                  *
*****************************************/

function isNotSelected(field, error_msg) {
	if(field.selectedIndex == 0) {
		alert(error_msg);
		field.focus() ;
		return true;
	} else {
		return false;
	}
}

/******************************
*  ±â´É :  Radio Button Check    *
*  ¼öÁ¤ÀÏ : 2002-01-25              *
*  parameter : field, error_msg  *
*******************************/
function isNotCheckedRadio(field, error_msg) {
	if ( field == null ) {
		alert(error_msg);
		return true;
	}

	if ( field.length == null ) {
		if ( field.checked == true ) {
			return false;
		} else {
			alert(error_msg);
			return true;
		}
	}

	for(i = 0; i < field.length; i++) {
		if(field[i].checked == true) {
			return false;
		}
	}
	alert(error_msg);
	return true;
}
//---------------//

/**
 * Radio ButtonÀ» ¼±ÅÃÇØÁ¦ÇÑ´Ù
 */
function uncheckRadio(field) {
	for(i = 0; i < field.length; i++) {
		field[i].checked = false;
	}
}

/**
 * Radio ButtonÀÇ ¼±ÅÃµÈ °ªÀ» °¡Á®¿Â´Ù
 */
function getRadioVal(field) {
	for(i = 0; i < field.length; i++) {
		if(field[i].checked == true)
			return field[i].value;
	}
	return "";
}

//------------------------------------- Æ¯Á¤ ÇÊµå °ü·Ã ÇÔ¼ö ---
function checkDupID(id)
{
	if(isEmpty(id, "ID¸¦ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotAlphaNumeric(id,"ID´Â 4~10ÀÚ »çÀÌÀÇ ¼ýÀÚ ¹× ¿µ¹® ´ë¼Ò¹®ÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	//if(isOutOfRange(id,4, 10, "ID´Â ÇÑ±Û 2ÀÚ~5ÀÚ, ¿µ¹® 4~10ÀÚ ÀÌ³»·Î ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
}

function checkName(name)
{
	if(isEmpty(name, "»ç¿ëÀÚ¸íÀ» ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
}

/*******************************
*  ±â´É : ºñ¹Ð¹øÈ£ Check            *
*  ¼öÁ¤ÀÏ : 2002-01-25                *
*  parameter : Form                  *
*******************************/
function isNotValidPassword(form) {

	if(isEmpty(form.password,"ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.password2,"ÆÐ½º¿öµå¸¦ ÀçÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	//if(isNotAlphaNumeric(form.password,"ºñ¹Ð¹øÈ£´Â 4~10ÀÚ »çÀÌÀÇ ¼ýÀÚ ¹× ¿µ¹® ´ë¼Ò¹®ÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	//if(isNotAlphaNumeric(form.password2,"ºñ¹Ð¹øÈ£´Â 4~10ÀÚ »çÀÌÀÇ ¼ýÀÚ ¹× ¿µ¹® ´ë¼Ò¹®ÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isOutOfRange(form.password, 4, 10, "ºñ¹Ð¹øÈ£´Â 4~10ÀÚ »çÀÌÀÇ ¼ýÀÚ ¹× ¿µ¹® ´ë¼Ò¹®ÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isOutOfRange(form.password2, 4, 10, "ºñ¹Ð¹øÈ£´Â 4~10ÀÚ »çÀÌÀÇ ¼ýÀÚ ¹× ¿µ¹® ´ë¼Ò¹®ÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(form.password.value != form.password2.value) {
		alert("ºñ¹Ð¹øÈ£°¡ ¼­·Î ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\n ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		form.password.value="";
		form.password2.value="";
		form.password.focus();
		form.password.select();
		return true;
	}
	return false;
}

/******************************
*  ±â´É : ÁÖ¹Îµî·Ï¹øÈ£ Check     *
*  ¼öÁ¤ÀÏ : 2002-01-25               *
*  parameter : Form                  *
*******************************/
function isNotValidPID(form) {

	if(isEmpty(form.pid1,"ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.pid2,"ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.pid1,"ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.pid2,"ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotExactLength(form.pid1, 6, "ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â 6ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.pid2, 7, "ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®´Â 7ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	strchr = form.pid1.value.concat(form.pid2.value);
	if (strchr.length == 13	) {
		nlength = strchr.length;

		num1 = strchr.charAt(0);
		num2 = strchr.charAt(1);
		num3 = strchr.charAt(2);
		num4 = strchr.charAt(3);
		num5= strchr.charAt(4);
		num6 = strchr.charAt(5);
		num7 = strchr.charAt(6);
		num8 = strchr.charAt(7);
		num9 = strchr.charAt(8);
		num10 = strchr.charAt(9);
		num11 = strchr.charAt(10);
		num12 = strchr.charAt(11);

		var total = (num1*2)+(num2*3)+(num3*4)+(num4*5)+(num5*6)+(num6*7)+(num7*8)+(num8*9)+(num9*2)+(num10*3)+(num11*4)+(num12*5);
		total = (11-(total%11)) % 10;
	//	if (total == 11) total = 1;
	//	if (total == 10) total = 0;

		if(total != strchr.charAt(12)) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
			form.pid1.value="";
			form.pid2.value="";
			form.pid1.focus();
			return true;
		}
		return false;
	}	else
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		form.pid1.value="";
		form.pid2.value="";
		form.pid1.focus();
		return true;
}
/******************************
*  ±â´É : »ç¾÷ÀÚµî·Ï¹øÈ£ Check  *
*  ¼öÁ¤ÀÏ : 2002-01-25               *
*  parameter : Form                  *
*******************************/
function isNotValidBID(form) {

	if(isEmpty(form.bid1,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.bid2,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.bid3,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.bid1,"»ç¾÷ÀÚµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.bid2,"»ç¾÷ÀÚµî·Ï¹øÈ£ °¡¿îµ¥ÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.bid3,"»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotExactLength(form.bid1, 3, "»ç¾÷ÀÚµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â 3ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.bid2, 2, "»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â 2ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.bid3, 5, "»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â 5ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	strchr = form.bid1.value.concat(form.bid2.value.concat(form.bid3.value));

	num1 = strchr.charAt(0);
	num2 = strchr.charAt(1);
	num3 = strchr.charAt(2);
	num4 = strchr.charAt(3);
	num5= strchr.charAt(4);
	num6 = strchr.charAt(5);
	num7 = strchr.charAt(6);
	num8 = strchr.charAt(7);
	num9 = strchr.charAt(8);
	num10 = strchr.charAt(9);

	var total = (num1*1)+(num2*3)+(num3*7)+(num4*1)+(num5*3)+(num6*7)+(num7*1)+(num8*3)+(num9*5);
	total = total + parseInt((num9 * 5) / 10);
	var tmp = total % 10;
	if(tmp == 0) {
		var num_chk = 0;
	} else {
		var num_chk = 10 - tmp;
	}

	if(num_chk != num10) {
		alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		form.bid1.value="";
		form.bid2.value="";
		form.bid3.value="";
		form.bid1.focus();
		return true;
	}
	return false;
}
/******************************
*  ±â´É :  E-Mail Check            *
*  ¼öÁ¤ÀÏ : 2002-01-25              *
*  parameter : field, error_msg  *
*******************************/
function isNotValidEmail(field)
{
   var checkflag = true;
   var retvalue;

   if(field.value == "") {
	   retvalue = true;
   } else {

	   if (window.RegExp) {
		  var tempstring = "a";
		  var exam = new RegExp(tempstring);
		  if (tempstring.match(exam)) {
			 var ret1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
			 var ret2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			 retvalue = (!ret1.test(field.value) && ret2.test(field.value));
		  } else {
			 checkflag = false;
		  }
	   } else {
		  checkflag = false;
	   }

	   if (!checkflag) {
		  retvalue = ( (field.value != "") && (field.value.indexOf("@")) > 0 && (field.value.index.Of(".") > 0) );
	   }

   }
   if(retvalue) { return false;
   } else {
		alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		field.focus();
		field.select();
		return true;
   }
}

/******************************
*  ±â´É :  TelNumber Check      *
*  ¼öÁ¤ÀÏ : 2002-01-25              *
*  parameter : field, error_msg  *
*******************************/
function isNotValidTel(field) {

   var Count;
   var PermitChar =
         "0123456789-";

   for (var i = 0; i < field.value.length; i++) {
      Count = 0;
      for (var j = 0; j < PermitChar.length; j++) {
         if(field.value.charAt(i) == PermitChar.charAt(j)) {
            Count++;
            break;
         }
      }

      if (Count == 0) {
         alert("ÀüÈ­¹øÈ£°¡ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")
		 field.focus();
		 field.select();
		 return true;
         break;
      }
   }
   return false;
}
//---------------//


function isNotValidChar(field,error_msg) {

   var Count;
   var PermitChar = "0123456789-";  // Çã¿ë°¡´ÉÇÑ ¹®ÀÚµéÀ» ¸ðµÎ ±â·ÏÇÑ´Ù.

   for (var i = 0; i < field.value.length; i++) {
      Count = 0;
      for (var j = 0; j < PermitChar.length; j++) {
         if(field.value.charAt(i) == PermitChar.charAt(j)) {
            Count++;
            break;
         }
      }

      if (Count == 0) {
         alert(error_msg);
		 field.focus();
		 field.select();
		 return true;
         break;
      }
   }
   return false;
}

function isNotValidChar2(field,error_msg) {

   var NotPermitChar = "\"";  //Çã¿ëµÇ¾î¼­´Â ¾ÈµÇ´Â ¹®ÀÚµéÀ» ¸ðµÎ ±â·ÏÇÑ´Ù.
//   var NotPermitChar = "<>\"^&|'\\ ";  //Çã¿ëµÇ¾î¼­´Â ¾ÈµÇ´Â ¹®ÀÚµéÀ» ¸ðµÎ ±â·ÏÇÑ´Ù.

   if(field.value == "") return false;
   for (var i = 0; i < field.value.length; i++) {
      for (var j = 0; j < NotPermitChar.length; j++) {
         if(field.value.charAt(i) == NotPermitChar.charAt(j)) {
            ans = confirm(error_msg);
			if(ans == true) {
				return false;
			} else {
				field.focus();
				field.select();
				return true;
			}
         }
      }
   }
   return false;
}

function auto_fill_birth(pid1) {

	var year = pid1.value.substr(0,2);
	var month = pid1.value.substr(2,2);
	var date = pid1.value.substr(4,2);
	document.forms[0].year.value = year;
	document.forms[0].month.value = month;
	document.forms[0].date.value = date;

}

function hide_in(field) {
	if(field.value == field.defaultValue) field.value = "";
}
function show_out(field) {
	if(field.value == "") field.value = field.defaultValue;
}

function checkNumber(objname)
{
	var intErr = 1;
	var strValue = objname.value;
	var retCode = 0;

	for(i = 0; i < strValue.length; i++)
	{
		var retCode = strValue.charCodeAt(i);
		var retChar = strValue.substr(i, 1).toUpperCase();

		retCode = parseInt(retCode);

		// "3.4"µµ ¼ýÀÚÀÌ´Ù.
		if(!((retChar >= "0" && retChar <= "9") || retChar == "."))
		{
			intErr = 0; // break;
		}
	}

	var periodCnt = 0;

	while(strValue.indexOf(".") != -1)
	{
		periodCnt++;

		strValue = strValue.substr(strValue.indexOf(".") + 1, strValue.length - (strValue.indexOf(".") + 1));
	}

	// "3..4"´Â ¼ýÀÚ°¡ ¾Æ´Ï´Ù.
	if(periodCnt > 1)
		intErr = 0;

	if (intErr!=1)
	{
		return true;
	}
	else return false;
}

/*function CheckID_onSubmit(form)
{
	if (form.id.value.length < 4 || form.id.value.length > 10 ||
	      IsAlphaNumeric(form.id.value) == false)
	{
	    alert("ÀÌ¿ëÀÚID´Â ¿µ¹®°ú ¼ýÀÚÀÇ Á¶ÇÕÀ¸·Î 4-10ÀÚ¸®³»¿¡¼­ ÀÔ·ÂÇÏ½Ê½Ã¿À. \nÇÑ±Û, ¶ç¾î¾²±â´Â ¾ÈµË´Ï´Ù! ");
	    form.id.focus();
	    return (false);
	}
	return (true);
}*/

/**
 * <PRE>
 * Scroll ÀÌ ¾ø´Â »õ Ã¢À» ¶ç¿î´Ù
 * </PRE>
 * @param   theURL : »õ·Î ¶ç¿ï ÆÄÀÏ ÀÌ¸§ÀÌ´Ù
 * @param   winName : »õÃ¢ ÀÌ¸§
 * @param   winTitle : »õÃ¢ title
 * @param	width : »õÃ¢ °¡·Î Å©±â
 * @param	height : »õÃ¢ ¼¼·Î Å©±â
 * @param   param : Ãß°¡ÀûÀÎ È­¸é argument
 */
function openNoScrollWin(theURL, winName, winTitle, width, height, param)
{
	var wid = (screen.width)/2 - width/2 ;
	var hei = (screen.height)/2 - height/2;
	var win = window.open(theURL + "?popupTitle=" + winTitle + "&tableWidth=" + width + param, winName, "menubar=no, scrollbars=no, resizable=no, width=" + width + ", height=" + height+ ",top=" + hei + ",left=" + wid + "");
	win.focus();
}

/**
 * <PRE>
 * Scroll ÀÌ ¾ø´Â »õ Ã¢À» ¶ç¿î´Ù
 * </PRE>
 * @param   theURL : »õ·Î ¶ç¿ï ÆÄÀÏ ÀÌ¸§ÀÌ´Ù
 * @param   winName : »õÃ¢ ÀÌ¸§
 * @param   winTitle : »õÃ¢ title
 * @param	width : »õÃ¢ °¡·Î Å©±â
 * @param	height : »õÃ¢ ¼¼·Î Å©±â
 * @param   param : Ãß°¡ÀûÀÎ È­¸é argument
 */
function openScrollWin(theURL, winName, winTitle, width, height, param)
{
	var wid = (screen.width)/2 - width/2 ;
	var hei = (screen.height)/2 - height/2;
	var win = window.open(theURL + "?popupTitle=" + winTitle + "&tableWidth=" + width + param, winName, "menubar=no, scrollbars=yes, resizable=no, width="+width+", height="+height+ ",top=" + hei + ",left=" + wid + "");
	win.focus();
}

/**
 * <PRE>
 * Á¦¾àÀÌ ¾ø´Â »õ Ã¢ ¶ç¿ì±â¸¦ ÇÏÀÚ
 * </PRE>
 * @param   theURL : »õ·Î ¶ç¿ï ÆÄÀÏ ÀÌ¸§ÀÌ´Ù
 * @param   winName : »õÃ¢ ÀÌ¸§
 * @param   winTitle : »õÃ¢ title
 * @param	width : »õÃ¢ °¡·Î Å©±â
 * @param	features : ´Ù¾çÇÑ ¸ð¾çÀ» Á÷Á¢ ÁØ´Ù
 * @param   param : Ãß°¡ÀûÀÎ È­¸é argument
 */
function openFlexWin(theURL,winName,winTitle, width, features, param)
{
	var win = window.open(theURL + "?popupTitle=" + winTitle + "&tableWidth=" + width + param,winName,features);
	win.focus();
}



///////////////////// Calendar ///////////////////////////

/* ³¯Â¥¸¸ ÀÔ·ÂÇØ¾ßÇÒ ¶§ */
function showDateCalendar(dateField)
{
	var wid = (screen.width)/2 - 560/2 ;
	var hei = (screen.height)/2 - 480/2; 
	window.open("/common/calendar/calendarsmall.jsp?type=date&dateField=" + dateField, "Calendar", "width=200,height=250,status=no,resizable=no,top=200,left=200");

} 
/* ³¯Â¥¸¸ ÀÔ·ÂÇØ¾ßÇÒ ¶§ -- ±×¸®µå
dateField = "gridName, row, col" */
function showDateCalendarGrid(dateField)
{
	var wid = (screen.width)/2 - 560/2 ;
	var hei = (screen.height)/2 - 480/2;
	window.open("/common/calendar/calendarsmall.jsp?type=date&subType=grid&dateField=" + dateField, "Calendar", "width=200,height=250,status=no,resizable=no,top="+hei+",left="+wid+"");
}
/* ³¯Â¥¿Í ½Ã°£ ¸ðµÎµé ÀÔ·ÂÇØ¾ßÇÒ ¶§ */
function showDateTimeCalendar(dateField, timeField)
{
	var wid = (screen.width)/2 - 560/2 ;
	var hei = (screen.height)/2 - 480/2;
		window.open("/common/calendar/calendarsmall.jsp?type=datetime&dateField=" + dateField + "&timeField=" + timeField, "Calendar", "width=220,height=295,status=no,resizable=no,top=200,left=200");

}
/* ³¯Â¥¿Í ½Ã°£ ¸ðµÎµé ÀÔ·ÂÇØ¾ßÇÒ ¶§ -- ±×¸®µå */
function showDateTimeCalendarGrid(dateField, timeField)
{
	var wid = (screen.width)/2 - 560/2 ;
	var hei = (screen.height)/2 - 480/2;
		window.open("/common/calendar/calendarsmall.jsp?type=datetime&subType=grid&dateField=" + dateField + "&timeField=" + timeField, "Calendar", "width=220,height=295,status=no,resizable=no,top=200,left=200");

}

/**
 * <PRE>
 * Æ¯Á¤ ÇÊµå¿¡ ´ëÇÑ ¼öÁ¤À» ¸·´Â ÇàÀ§
 * </PRE>
 * @param   objectName : ¼öÁ¤À» ÁßÁö½ÃÅ³ ÇÊµå°´Ã¼.(ÁÖ·Î input type)
 */
function editStop(objectName) {
	objectName.blur();
}

/**
 * ¼ýÀÚ³ª ¹®ÀÚ¿­À» ÅëÈ­(Money) Çü½ÄÀ¸·Î ¸¸µç´Ù.( ½°Ç¥(,) Âï´Â´Ù´Â ¼Ò¸®.. )
 * @param	amount	"1234567"
 * @return	currencyString "1,234,567"
 */
function formatCurrency(amount)
{
	amount = new String(amount);
	var amountLength = amount.length;
	var modulus = amountLength % 3;
	var currencyString = amount.substr(0,modulus);
	for(i=modulus; i<amountLength; i=i+3) {
		if(currencyString != "") 
			currencyString += ",";
		currencyString += amount.substr(i, 3);
	}
	return currencyString;
}

///////////////////// LotteMRO Specific Functions ///////////////////////////
/**
 * ¾ÆÀÌÅÛ ¼ö·®º° ÇÒÀÎ°¡¸¦ ¹ÝÈ¯ÇÑ´Ù(¼ö·®º° ÇÒÀÎ°¡ Á¤º¸°¡ ¾øÀ» °æ¿ì ±âº»°¡ ¹ÝÈ¯)
 *
 * @param	arrDiscount	¼ö·®º° ÇÒÀÎ°¡ ¹è¿­
 * @param	qty	¼ö·®
 * @param	defaultSellPrice	±âº» °¡°Ý
 * @return	discountPrice	ÇÒÀÎ°¡
 */
function calcDiscountPrice(arrDiscount, qty, defaultSellPrice)
{
	var discountPrice = defaultSellPrice;
	var prevQty = 0;

	for( i=0; i<arrDiscount.length; i++ ) {
		if(qty >= prevQty && qty < arrDiscount[i][0]) {
			break;
		} else {
			discountPrice = arrDiscount[i][1];
			prevQty = arrDiscount[i][0];
		}
	}
	
	return discountPrice;
}
/**
 * ¾ÆÀÌÅÛ ÆÇ¸Å°¡¸¦ ¹ÝÈ¯ÇÑ´Ù(¼ö·®º° ÇÒÀÎ°¡ Á¤º¸°¡ ¾øÀ» °æ¿ì ±âº»°¡ ¹ÝÈ¯)
 *
 * @param	arrDiscount	¼ö·®º° ÇÒÀÎ°¡ ¹è¿­
 * @param	qty	¼ö·®
 * @param	defaultSellPrice	±âº» °¡°Ý
 * @param	addedPrice	¿É¼ÇÀ¸·Î ÀÎÇØ Ãß°¡µÈ °¡°Ý(¿É¼Ç°¡ ÃÑÇÕ)
 * @return	ÆÇ¸Å°¡
 */
function calcSellPrice(arrDiscount, qty, defaultSellPrice, addedPrice)
{
	return (calcDiscountPrice(arrDiscount, qty, defaultSellPrice) + addedPrice) * qty;
}
/**
 * ¾ÆÀÌÅÛ ¿ø°¡¸¦ ¹ÝÈ¯ÇÑ´Ù
 *
 * @param	defaultPrimeCost	±âº» °¡°Ý
 * @param	addedPrice	¿É¼ÇÀ¸·Î ÀÎÇØ Ãß°¡µÈ °¡°Ý(¿É¼Ç°¡ ÃÑÇÕ)
 * @return	¿ø°¡
 */
function calcPrimeCost(defaultPrimeCost, addedPrice)
{
	return defaultPrimeCost + addedPrice;
}

/*
 * »ç¾÷ÀÚ µî·Ï ¹øÈ£¸¦ °Ë»çÇÑ´Ù.
 */
function isNotValidBIZ(form) {

	if(isEmpty(form.bizregno1,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.bizregno2,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.bizregno3,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.bizregno1,"»ç¾÷ÀÚµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.bizregno2,"»ç¾÷ÀÚµî·Ï¹øÈ£ °¡¿îµ¥ÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.bizregno3,"»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotExactLength(form.bizregno1, 3, "»ç¾÷ÀÚµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â 3ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.bizregno2, 2, "»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â 2ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.bizregno3, 5, "»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â 5ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	strchr = form.bizregno1.value.concat(form.bizregno2.value.concat(form.bizregno3.value));

	num1 = strchr.charAt(0);
	num2 = strchr.charAt(1);
	num3 = strchr.charAt(2);
	num4 = strchr.charAt(3);
	num5 = strchr.charAt(4);
	num6 = strchr.charAt(5);
	num7 = strchr.charAt(6);
	num8 = strchr.charAt(7);
	num9 = strchr.charAt(8);
	num10 = strchr.charAt(9);

	var total = (num1*1)+(num2*3)+(num3*7)+(num4*1)+(num5*3)+(num6*7)+(num7*1)+(num8*3)+(num9*5);
	total = total + ((num9 * 5) / 10);
	var tmp = total % 10;
	if(tmp == 0) {
		var num_chk = 0;
	} else {
		var num_chk = 10 - tmp;
	}

	if(num_chk != num10) {
		alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		form.bizregno1.value="";
		form.bizregno2.value="";
		form.bizregno3.value="";
		form.bizregno1.focus();
		return true;
	}
	return false;
}

/**
 * ConfirmÃ¢À» ¶ç¿ì°í "¿¹"ÀÌ¸é false¸¦ "¾Æ´Ï¿À"ÀÌ¸é true¸¦ ¸®ÅÏÇÑ´Ù
 * (JSP »ç¿ë¿¹ : if(didNotConfirm("ÁÖ¹®À» Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?")) return;)
 */
function didNotConfirm(question) {
	return !confirm(question);
}

/**
 * °Ë»ö¾î°¡ ÀÔ·ÂµÇ´Â FORM element¸¦ ÃÊ±âÈ­ ÇÑ´Ù.
 * 
 * @param	°Ë»ö¾î ÀÔ·Â FORM
 */
function doInit(frm)
{
	for (i = 0; i < frm.elements.length; i++)
	{
		frm.elements[i].value = "";
	}
}

/******************************
*  ±â´É :  Positive NumberCheck           *
*  ¼öÁ¤ÀÏ : 2002-04-10(withsun)              *
*  parameter : field, error_msg  *
*******************************/
function isNotPositiveNumber(field, error_msg)
{
   for (var i=0; i < field.value.length; i++)
   {
      if ( field.value.charAt(i) < "1" || field.value.charAt(i) > "9" )
	  {
         alert(error_msg);
		 field.focus();
		 field.select();
		 return true;
	   }
   }
}


/**
 * ENTERÅ° ´Ù¿î µÇ¾úÀ»¶§ ³Ñ°Ü¹ÞÀº Function½ÇÇà
 *
 * @param	func	½ÇÇàÇÒ Function¸í
 */
function enterKeyDown(func)
{
	enter = event.keyCode;
	if(enter == 13)
	{
		eval(func);
	}

}

/**
 * Æ¯Á¤Å° ´Ù¿î µÇ¾úÀ»¶§ ³Ñ°Ü¹ÞÀº Function½ÇÇà
 *
 * @param	func	½ÇÇàÇÒ Function¸í
 */
function keyDown(func)
{
	enter = event.keyCode;
	if(enter == 13)
	{
		eval(func);
	}

}


/**
 * ÁÖ¾ðÁø 8ÀÚ¸® ¹®ÀÚ¿­À» ³¯Â¥Æ÷¸Ë(YYYY-MM-DD or YYYY/MM/DD)·Î ¹Ù²Ù¾îÁØ´Ù.
 *
 * @param	source		º¯È¯ÇÒ 8ÀÚ¸® ³¯Â¥¹®ÀÚ¿­
 * @param	format		³¯Â¥Çü½Ä
 * @return	ret			º¯È¯µÈ ³¯Â¥ ¹®ÀÚ¿­
 **/
function dateFormat(source, format)
{
	ret = "";
	delimiter = "";

	if (format.indexOf("-") != -1)
		delimiter = "-";
	else if (format.indexOf("/") != -1)
		delimiter = "/";
	else
	{
		alert("ÀÔ·ÂµÈ ³¯Â¥Æ÷¸ËÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
		return;
	}

	if (source.length == 8)
	{
		ret = source.substring(0, 4) + delimiter + source.substring(4, 6) + delimiter + source.substring(6, 8);
	} else if (source.length == 10)
	{
		ret = source.substring(0, 4) + delimiter + source.substring(5, 7) + delimiter + source.substring(8, 10);
	} else
	{
		alert("ÀÔ·ÂµÈ ³¯Â¥Çü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");
		return;
	}
	return ret;
}

/**
 * ³¯Â¥Çü½ÄÀÌ ¿Ã¹Ù¸¥Áö °Ë»ç
 *
 * @param	astrValue	³¯Â¥Æ÷¸Ë(yyyymmdd, yyyy/mm/dd, yyyy-mm-dd)
 * @param	astrNotNull:	nn:not null, "": null Çã¿ë
 * @return	true/false
 **/
function blnOkDate(astrValue, astrNotNull)
{
	var arrDate;
	
	if (astrValue=='')
	{
		if (astrNotNull == "nn")
			return false;
		else
			return true;
	}else{	
		if (astrValue.indexOf("-") != -1) 
			arrDate = astrValue.split("-");
		else if (astrValue.indexOf("/") != -1) 
			arrDate = astrValue.split("/");
		else
		{
			if (astrValue.length != 8) return false;
			astrValue = astrValue.substring(0,4)+"/"+astrValue.substring(4,6)+"/" +astrValue.substring(6,8);
			arrDate = astrValue.split("/");
		}
	
		if (arrDate.length != 3) return false;		
		
		var chkDate = new Date(arrDate[0] + "/" + arrDate[1] + "/" + arrDate[2]);		
		if (isNaN(chkDate) == true ||
			(arrDate[1] != chkDate.getMonth() + 1 || arrDate[2] != chkDate.getDate())) 
		{
			return false;
		}
	}
	return true;
}


/**
 * ±×¸®µå ³¯Â¥ ¼¿¿¡¼­ ³¯Â¥¸¦ ÀÔ·Â¹Þ°í¼­ À¯È¿ÇÑÁö Ã¼Å©(yyyymmdd or yyyy-mm-dd or yyyy/mm/dd)ÈÄ Æ²¸®¸é Calendar Popup
 *
 * @param	fgName	±×¸®µå°´Ã¼¸í
 * @param	row		Çà¼ö
 * @param	col		¿­¼ö
 **/
function openCalendarInGrid(fgName, row, col)
{
	var fg = document.all(fgName);
	if (!blnOkDate(fg.TextMatrix(row, col), "nn"))
	{
		fg.TextMatrix(row, col) = "";
		showDateCalendarGrid(fgName + ", " + row + ", " + col);
	}
	else
		fg.TextMatrix(row, col) = dateFormat(fg.TextMatrix(row, col), "YYYY-MM-DD");

}

/**
 * INPUT field¿¡¼­ ³¯Â¥¸¦ ÀÔ·Â¹Þ°í¼­ À¯È¿ÇÑÁö Ã¼Å©(yyyymmdd or yyyy-mm-dd or yyyy/mm/dd)ÈÄ Æ²¸®¸é Calendar Popup
 *
 * @param field INPUT °´Ã¼
 **/
function openCalendar(dateField)
{
 var obj = eval("document." + dateField);
 
 if (obj.value == "")
  return;
 if (!blnOkDate(obj.value, "nn"))
 {
  obj.value = "";
  showDateCalendar(dateField);
 }
 else
  obj.value = dateFormat(obj.value, "YYYY-MM-DD");
 
}

/**
 * ¹®ÀÚ¿­³»¿¡ ÀÖ´Â ', "¸¦ \', \" ·Îº¯È¯ÇÑ´Ù.
 *
 * @param	str	º¯È¯ÇÒ ¹®ÀÚ¿­
 **/
function toValidStr(str)
{
/*	alert(str);
	var ret = "";
	for (i = 0; i < str.length; i++)
	{
		if (str.charAt(i) == '\'')
			ret += '\\\'';
		else if (str.charAt(i) == '"')
			ret += '\\\"';
		else
			ret += str.charAt(i);
	}
*/
	
	re1 = /\'/gi;
	re2 = /\"/gi;
	str = str.replace(re1, "\\\'");
	str = str.replace(re2, "\\\""); 
	return str;
	
	
}

function encChar(str)
{
	var temp1 = "@@@@@";
	re1 = /\'/g;
	re2 = /\"/g;
	str = str.replace(re1, temp1);
	return str;
}	

function decChar(str)
{
	re3 = /@@@@@/g;
	str = str.replace(re3, "'");
	return str;
}


// systemÀÇ ÇöÀç³¯Â¥¸¦ return: yyyymmdd
function strGetToDay()
{
 	 var today=new Date();
 	 
 	 var strToDay = today.getYear();
 	 
 	 if (today.getMonth()+1 < 10)
 	 	strToDay += "-0"+(today.getMonth()+1);
 	 else
 	 	strToDay += "-" + today.getMonth()+1;
 	 
 	 if (today.getDate() < 10)
 	 	strToDay += "-0"+today.getDate();
 	 else
 	 	strToDay += "-" + today.getDate();
 	 	
 	 return strToDay; 	 	 
}

//ÁÖ¾îÁø °ª(val)À» ¼Ò¼öÁ¡ÀÌÇÏ numÀÚ¸®¼ö¿¡¼­ ¹Ý¿Ã¸²ÇÑ°ªÀ» ¸®ÅÏÇÑ´Ù.
function round(val, num)
{
	val = val * Math.pow(10, num - 1);
	val = Math.round(val);
	val = val / Math.pow(10, num - 1);
	return val;
}


function isVaildMail(email)
{
     var result = false;

     if( email.indexOf("@") != -1 )
     {
          result = true;

          if( email.indexOf(".") != -1 )
          {
               result = true;
          }
          else
          {
               result = false;
          }
     }
     return result;
}



function isLoginname(obj) {
    len = obj.value.length;
    ret = true;

    if (len < 4)
		return false;
    if(!((obj.value.charAt(0) >= "a" && obj.value.charAt(0) <= "z") ||
       (obj.value.charAt(0) >= "A" && obj.value.charAt(0) <= "Z")))
		ret = false;		
    for (i = 1; i < len; i++) {
		if((obj.value.charAt(i) >= "0" && obj.value.charAt(i) <="9") ||
		   (obj.value.charAt(i) >= "a" && obj.value.charAt(i) <= "z") ||
		   (obj.value.charAt(i) >= "A" && obj.value.charAt(i) <= "Z"))
		    ;
		else 
		    ret = false;
    }
    return ret;
		   
}


//Æ¯Á¤ ÇÊµå°ª¿¡ ´ëÇØ¼­ ³¡ÀÚ¸®¸¦ 10´ÜÀ§·Î  ÀüÈ¯
function roundValue(field) {

  field.value = Math.round(eval(field.value)/10) * 10

}

/*
 * »ç¾÷ÀÚ µî·Ï ¹øÈ£¸¦ °Ë»çÇÑ´Ù.
 */
function isNotValidBIZNo(form) {

	if(isEmpty(form.site_serial1,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.site_serial2,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isEmpty(form.site_serial3,"»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.site_serial1,"»ç¾÷ÀÚµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.site_serial2,"»ç¾÷ÀÚµî·Ï¹øÈ£ °¡¿îµ¥ÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotNumber(form.site_serial3,"»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â ¼ýÀÚ·Î¸¸ ±âÀÔÇØ ÁÖ¼¼¿ä!")) return true;
	if(isNotExactLength(form.site_serial1, 3, "»ç¾÷ÀÚµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â 3ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.site_serial2, 2, "»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â 2ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	if(isNotExactLength(form.site_serial3, 5, "»ç¾÷ÀÚµî·Ï¹øÈ£ µÞÀÚ¸®´Â 5ÀÚ¸®ÀÔ´Ï´Ù!")) return true;
	strchr = form.site_serial1.value.concat(form.site_serial2.value.concat(form.site_serial3.value));

	num1 = strchr.charAt(0);
	num2 = strchr.charAt(1);
	num3 = strchr.charAt(2);
	num4 = strchr.charAt(3);
	num5 = strchr.charAt(4);
	num6 = strchr.charAt(5);
	num7 = strchr.charAt(6);
	num8 = strchr.charAt(7);
	num9 = strchr.charAt(8);
	num10 = strchr.charAt(9);

	var total = (num1*1)+(num2*3)+(num3*7)+(num4*1)+(num5*3)+(num6*7)+(num7*1)+(num8*3)+(num9*5);
	total = total + parseInt((num9 * 5) / 10);
	var tmp = total % 10;

	if(tmp == 0) {
		var num_chk = 0;
	} else {
		var num_chk = 10 - tmp;
	}

	if(num_chk != num10) {
		alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		form.site_serial1.value="";
		form.site_serial2.value="";
		form.site_serial3.value="";
		form.site_serial1.focus();
		return true;
	}
	return false;
}

/**
 * TABÅ° ´Ù¿î µÇ¾úÀ»¶§ ³Ñ°Ü¹ÞÀº Function½ÇÇà
 *
 * @param	func	½ÇÇàÇÒ Function¸í
 */
function tabKeyDown(func)
{
	enter = event.keyCode;
	if(enter == 09)
	{
		eval(func);
	}

}

///////////////////// 2002.07.03 Ãß°¡ ///////////////////
function trim(str) { 
	var count = str.length; 
	var len = count;                 
	var st = 0; 
	while ((st < len) && (str.charAt(st) <= ' ')) { 
		st++; 
	} 
	while ((st < len) && (str.charAt(len - 1) <= ' ')) { 
		len--; 
	}                 
	return ((st > 0) || (len < count)) ? str.substring(st, len) : str ;   
}

/////////////////////////MENU Botton Ã³¸® ///////////////////////


///////////////////////////////////////////////////////////////////
// Function name	: connectMenuEvents
// Description	    : 
// Return type		: function 
///////////////////////////////////////////////////////////////////
function connectMenuEvents()
{
	window.document.onmousedown = onMouseDown;
	window.document.onmousemove = onMouseMove;
	window.document.onclick = onClick;
	window.document.onunload = onCloseDocument;

	if (ie55) 
	{		
		oPopup = window.createPopup();
	}
}

///////////////////////////////////////////////////////////////////
// Function name	: setClassName
// Description	    : sets the class name safely on both browsers
// Return type		: void
// Argument         : theEl
// Argument         : name
///////////////////////////////////////////////////////////////////
function setClassName(theEl, name)
{
	if (theEl)
	{
		theEl.setAttribute(document.all ? 'className' : 'class', name);
	}
}


///////////////////////////////////////////////////////////////////
// Function name	: getClassName
// Description	    : returns the class name for an html element
// Return type		: string
// Argument         : theEl
///////////////////////////////////////////////////////////////////
function getClassName(theEl)
{
	if (theEl)
	{
		return theEl.getAttribute(document.all ? 'className' : 'class');
	}
	else
	{
		return ('class');
	}
}
///////////////////////////////////////////////////////////////////
// Function name	: onCmdBtnEvent
// Description	    : Command button handlers for detail/datasheet buttons
function onCmdBtnEvent(el, which, stylePrefix)
{
	var name = 'cmdbtn';

	if (stylePrefix)
	{
		name = stylePrefix;
	}
	else
	{
		var cs = getClassName(el);		
		if (cs.search('lbds2') >= 0)
		{			
			name = 'lbds2';			
		}		
		else if (cs.search('lbds1') >= 0)
		{
			name = 'lbds1';
		}		
	}	

	//--- don't change anything when this element is the 'more or lightbulb' button

	if (oPopup && s_currentMenuButton == el && oPopup.isOpen) 
		return;

	if (0 == which)
	{
		name += 'down';
	}
	else if (1 == which)
	{
		name += 'down';
	}
	else if (2 == which)
	{
		name += 'over';
	}
	else
	{
		name += 'out';
	}

	setClassName(el, name);	
	
}

function onCmdBtnDown(el, stylePrefix)
{
	onCmdBtnEvent(el, 0, stylePrefix);	
}

function onCmdBtnUp(el, stylePrefix)
{
	onCmdBtnEvent(el, 1, stylePrefix);
}

function onCmdBtnOver(el, stylePrefix, srcField)
{
	if (srcField != null)
	{
		var wF = self.frames['sicmdsrc'];
		if (wF)
		{
			try
			{
				var sTip = wF.getTooltip(srcField);			
			}
			catch(e)
			{

			}

			if (sTip)
			{
				el.title = sTip;
			}
		}		
	}

	onCmdBtnEvent(el, 2, stylePrefix);
}

function onCmdBtnOut(el, stylePrefix)
{
	onCmdBtnEvent(el, 3, stylePrefix);
}
//--- end cmd button handlers
///////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////
//--- context menu handlers

var gCurrentlyShownMenu = null;
var oldheight;
var oldwidth;
var gMenuCounter = 0;
var gCurrentButton = null;
var gCurrentButtonIndex= null;
var oPopup = null;
var curWidth = null;
var curHeight = null;
var s_currentMenuButton = null;

//--- function hideChoice hides the dropdown menu for all browser except ie55
function hideChoice()
{
	if ( ! gCurrentlyShownMenu || gMenuCounter)
	{
		gMenuCounter = 0;
		return;
	}
	if (gCurrentButton)
	buttonFunction(gCurrentButton, gCurrentButtonIndex, -1)
	var men = gCurrentlyShownMenu;

	men.style.height= oldheight ;
	men.style.width= oldwidth ;
	men.style.visibility='hidden';
	men.style.top= -2000;
	men.style.left= -2000;

	/*
	if (ns6 && !moz)
	{
		CenterContent0.style.overflow='auto';
		CenterContent1.style.overflow='auto';
		Left.style.overflow='auto';
		Right.style.overflow = 'auto';
	}
	*/
	gCurrentlyShownMenu=null;
	gCurrentButton = null;
	gCurrentButtonIndex= null;

}

function showChoice(divid, button, colorindex)
{
	//--- if this doesn't exist, then the detail didn't call onLoadDetail
	if (!ns6 && !oPopup)
	{
		alert('The menu you are opening is not yet available. Please try again after the entire page has loaded.');
		return;
	}

	s_currentMenuButton = button;

	if (ie55)
		showPopup(divid, button, colorindex);
	else 
		showDivMenu(divid, button, colorindex);
}

function showDivMenu(divid, button, colorindex )
{

	var a = document.getElementById(divid);

	if (!a) 
	{
		return (false);
	}

	if (gCurrentlyShownMenu)
	{
		hideChoice();
	}

	gCurrentlyShownMenu = a;
	
	
	gMenuCounter = 1;
	var nsoffset =0;
	if (ns6) nsoffset = 6;
	var wid=a.offsetWidth - nsoffset;
	var hig=a.offsetHeight - nsoffset;
	oldheight=hig;
	oldwidth=wid;
	var down = 1;
	var lef=1;
	var up = hig + LastY;
	var right = wid + LastX;
	if (up > Browser.vHEIGHT())	down=0;
	if (right > Browser.vWIDTH()) lef=0;
	a.style.width="1";
	a.style.height="1";
	a.style.zIndex = 500;
	a.style.top = LastY ;
	a.style.left = LastX ;
	a.style.visibility = 'visible';
	
	/*
	if (ns6 && !moz)
	{

		CenterContent0.style.overflow ='hidden';
		CenterContent1.style.overflow ='hidden';
		Left.style.overflow ='hidden';
		Right.style.overflow ='hidden';
	}
	*/

	growMenu (divid,wid,hig,down,lef);
	return false;
}

function growMenu (divid, wid, hig, down, lef)
{
	divide = 8;	
	var a= document.getElementById(divid);
	var i=a.offsetWidth;
	var j=a.offsetHeight;
	if (i < wid)
	{
		if (lef==1) a.style.width=parseInt(a.style.width)+Math.ceil(wid/divide);
		if (lef==0)
		{
			a.style.width=parseInt(a.style.width)+Math.ceil(wid/divide);
			a.style.left=parseInt(a.style.left)-Math.ceil(wid/divide);
		}
	}
	if (j < hig)
	{
		if (down==1) a.style.height=parseInt(a.style.height)+Math.ceil(hig/divide);
		if (down==0)
		{
			a.style.height=parseInt(a.style.height)+Math.floor(hig/divide);
			a.style.top=parseInt(a.style.top)-Math.ceil(hig/divide);
		}
	}
	if (i >= wid && j >=hig )
	{
		a.style.width = wid;
		a.style.height = hig + 6;
		return;
	}
	window.setTimeout("growMenu('" + divid +"',"+ wid + "," + hig + "," + down + "," + lef +");", 5);
}

//--- ie 55 hides popup dropdown
function closePopup()
{
	gCurrentButton = null;
	gCurrentButtonIndex= null;
	oPopup.hide();
}


function showPopup(divid, button, colorindex)
{	
	var divContents = document.getElementById(divid);
	if (!divContents)	
	{			
		return false;
	}
	
	
	curWidth= 1;
	curHeight= 1;

	var doc = oPopup.document;
	
	//--- add the default stylesheet
	doc.open();		
	doc.writeln('<html>');
	doc.writeln('<head>');	
	doc.writeln('<link rel=\"StyleSheet\" href=\"default6.css\" type=\"text/css\" media=\"screen\" />');	
	doc.writeln('</head>');		
	doc.writeln('<body class=\"ctxmenu\" style=\"margin: 2px; border: #808080 1px solid; overflow: hidden\">');	
	doc.writeln('</body>');	
	doc.close();

	var oPopupBody = oPopup.document.body;

	//--- innerHTML is from the specified div (on the page)

	oPopupBody.innerHTML = document.getElementById(divid).innerHTML;
	oPopupBody.onclick = onClick;
	
	oPopup.show(LastX, LastY, curWidth, curHeight, document.body);

	//--- resizes the popup window to fix the menus
	growPopup(divid, divContents.offsetWidth, divContents.offsetHeight);
}


function growPopup(divid, wid, hig)
{
	var divide = 8;
	
	if (curWidth < wid)
	{
		curWidth += Math.ceil(wid/divide);
	}
	
	if (curHeight < hig)
	{
		curHeight += Math.ceil(hig/divide);
	}
	
	if ((curWidth >= wid) && (curHeight >= hig))
	{
		curWidth = wid;
		curHeight = hig + 4;	//--- because of the border on the body
		oPopup.show(LastX, LastY, curWidth, curHeight,  document.body);
		return;
	}

	oPopup.show(LastX, LastY, curWidth, curHeight,  document.body);
	window.setTimeout("growPopup('" + divid +"',"+ wid + "," + hig  +");",5);
}


// drop down menu functions end
//////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////
//--- body events for the menu
function onMouseDown(evt)
{
	LastX = getclickx(evt, true);
	LastY = getclicky(evt, true);

	if (ns6)
	{
		if (evt.which)
		{
			LastButton = evt.which;
		}
	}
	else if (event.button)
	{
		LastButton = event.button;
		return false;
	}
}

function onMouseMove(evt)
{
	if (oPopup && !oPopup.isOpen && s_currentMenuButton)
	{
		var el = s_currentMenuButton;
		s_currentMenuButton = null;
		onCmdBtnOut(el);		
	}
}


function onClick(evt)
{	
	if (oPopup && !oPopup.isOpen && s_currentMenuButton)
	{
		var div = s_currentMenuButton;
		s_currentMenuButton = null;		
		onCmdBtnOut(div);		
	}
	else if (ns6 && s_currentMenuButton)
	{
		hideChoice();
	}

	
}

function onCloseDocument(evt)
{
	closePopupWindow();
}


	/**
	 * ³¯Â¥ Æ÷¸Ë Ã¼Å©
	 */
	function date_format(v_object) {
		var v_date = v_object.value;
		var yy = "";
		var mm = "";
		var dd = "";
		var len;
				
		v_date = delChar(v_object.value, "-");

		len = v_date.length;

		if (len == 8) {
			yy = v_date.substring(0, 4);
			mm = v_date.substring(4, 6);
			dd = v_date.substring(6, 8);
			
			if(blnOkDate(v_date, "") == false){
				alert("Á¶È¸±â°£ÀÇ ³¯Â¥Çü½ÄÀÌ Æ²·È½À´Ï´Ù.");  
				v_object.select();
				return;
			} else {
				v_object.value = return_date; 
			}
		}		
	}

	/**
	 * ¹®ÀÚ¿­¿¡¼­ Æ¯Á¤¹®ÀÚ Á¦¿ÜÇÏ¿© ¹®ÀÚ¿­ Á¶ÇÕ
	 */
	function delChar(newValue, ch) {
		var len = newValue.length;
		var ret = "";
		
		for (i=0; i<len; ++i) {
			if (newValue.substring(i,i+1) != ch) {
				ret = ret + newValue.substring(i,i+1);
			}
		}
		
		return ret;
	}


	/**
	 * ³¯Â¥Çü½ÄÃ¼Å©(¹æ¹ý)
	 **/
	function blnOkDate(astrValue, astrNotNull) {
		var arrDate;
		
		if (astrValue=='')
		{
			if (astrNotNull == "nn")
				return false;
			else
				return true;
		}else{	
			if(astrValue.length == 10) {
				if (astrValue.indexOf("-") != -1){ 
					arrDate = astrValue.split("-");
				}else{
					return false;
				}
				
				if (arrDate.length != 3) return false;		
				
				var chkDate = new Date(arrDate[0] + "/" + arrDate[1] + "/" + arrDate[2]);
				
				if (isNaN(chkDate) == true || (arrDate[1] != chkDate.getMonth() + 1 || arrDate[2] != chkDate.getDate())) {
					return false;
				} else {
					return return_date = astrValue;
				}
			} else if (astrValue.length == 8) {
				
				var chkDate = new Date(astrValue.substring(0,4) + "/" + astrValue.substring(4,6) + "/" + astrValue.substring(6));	
				
				if (isNaN(chkDate) == true || (astrValue.substring(4,6) != chkDate.getMonth() + 1 || astrValue.substring(6) != chkDate.getDate())) {
					return false;
				} else {
					return return_date = astrValue.substring(0,4) + "-" + astrValue.substring(4,6) + "-" + astrValue.substring(6);
				}
			} else {
				return false;
			}
		}
	}
//////////////////////////////////////////////////////////////////////////////////



/**
 * ¼¿·ºÆ® ¹Ú½º¸¦ ¿øÇÏ´Â °ªÀ¸·Î ¼ÂÆÃÇÏ´Â ÇÔ¼ö
 *
 * @param	objFrm	document.ÇÁ·¹ÀÓ¸í.¼¿·ºÆ® ¹Ú½º ÀÌ¸§
 * @param	val	    ¼ÂÆÃÇÒ °ª
 */
function setSelectVal ( objFrm, val ) {
    var len = objFrm.options.length;

    if ( !len ) {
        return;
    }
	
    for ( var n = 0; n < len; n++ ) {
		
        if ( objFrm.options[n].value == val ) {
	    objFrm.options[n].selected = true;
	}
    }
}


/**
 * ¶óµð¿À ¹öÆ°, Ã¼Å©¹Ú½º¸¦ ¿øÇÏ´Â °ªÀ¸·Î ¼ÂÆÃÇÏ´Â ÇÔ¼ö
 *
 * @param	objFrm	document.ÇÁ·¹ÀÓ¸í.¶óµð¿À ¹öÆ° ÀÌ¸§
 * @param	val	    ¼ÂÆÃÇÒ °ª
 */

function setRadioVal (objFrm, val) {
	var len = objFrm.length;
	if (!len) {
		objFrm.checked = true;
	} else {
		for (var n = 0; n < len; n++) {
			if (objFrm[n].value == val)
				objFrm[n].checked = true;
		}
	}
}




/*************************************************************************
* ´º¿å¿£Á¶ÀÌ Ãß°¡ ½ºÅ©¸³Æ®
* @auth  2003.08.12 ÀÌÁö¿¬
*/

/*************************************************************************
* Grid ÀÏÀÚ Çü½Ä Check
*/
function isNotDate(fgName, row, col, msg)
{
	var fg = document.all(fgName);
	if (!blnOkDate(fg.TextMatrix(row, col), "nn")) {
		alert(msg);
		fg.Row = row;
		fg.Col = col;
		fg.focus();
		return true;
	} else {
		fg.TextMatrix(row, col) = dateFormat(fg.TextMatrix(row, col), "YYYY-MM-DD");
		return false;
	}
}

/*************************************************************************
* Grid ¼ýÀÚ Çü½Ä Check
*/
function isNotValue(fgName, row, col, msg) {

	var fg = document.all(fgName);
	var value = fg.TextMatrix(row, col);

	if(value == "") {
		alert("µ¥ÀÌÅÍ¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À");
		fg.Row = row;
		fg.Col = col;
		fg.focus();
		return true;	
	}

	if(isNaN(value) || value.substring(0,1) == "." || value.substring(value.length-1) == ".") {
		alert(msg);
		fg.TextMatrix(row, col) = "";
		fg.Row = row;
		fg.Col = col;
		fg.focus();
		return true;	
	}

	return false;
}

/*************************************************************************
* ÀÏÀÚ Çü½Ä Check
*/
var daytab1 = new Array("31","28","31","30","31","30","31","31","30","31","30","31")
var daytab2 = new Array("31","29","31","30","31","30","31","31","30","31","30","31")

function dateCheckFormat(source)
{
	if(window.event.keyCode == 8) return ;
	if(window.event.keyCode == 37) return ;
	if(window.event.keyCode == 39) return ;

    // ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô Ã³¸®
    for(var i=0; i < source.value.length; i++)
        if(!isDecimal(source.value.charAt(i)))
           source.value = source.value.substring(0,i) + source.value.substring(i+1,source.value.length);

    if (source.value.length > 11) source.value = source.value.substring(0,11);
    
    	if(source.maxLength==13)
	{
		switch(source.value.length)
		{
			case 1: break;
			case 2: break;
			case 3: break;
			case 4: source.value = source.value + "-"; break;
			case 5: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,5);break;
			case 6: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-";break;
			case 7: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,7);break;
			case 8: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,8)+" ";break;
			case 9: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,8)+""+source.value.substring(8,9);break;
			case 10: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,8)+""+source.value.substring(8,10);break;
			case 11: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,8)+""+source.value.substring(8,11);break;
		}
		if (source.value.length < 13) return;
	}
	else if(source.maxLength==7)
	{
		switch(source.value.length)
		{
			case 1: break;
			case 2: break;
			case 3: break;
			case 4: source.value = source.value + "-"; break;
			case 5: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,5);break;
			case 6: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6);break;
		}
		if (source.value.length < 7) return;
	}
	else{	
		switch(source.value.length)
		{
			case 1: break;
			case 2: break;
			case 3: break;
			case 4: source.value = source.value + "-"; break;
			case 5: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,5);break;
			case 6: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-";break;
			case 7: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,7);break;
			case 8: source.value = source.value.substring(0,4)+"-"+source.value.substring(4,6)+"-"+source.value.substring(6,8);break;
		}
		if (source.value.length < 10) return;
	}

    var year  = source.value.substring(0,4);
    var month = source.value.substring(5,7);

    if ((month < 1 || month > 12) || (month.indexOf("-") > -1))
    {
        alert("ÀÏÀÚ(¿ù) Çü½ÄÀÌ Æ²¸³´Ï´Ù.");
        source.value = "";
        source.focus();
        return false;
    }

    if(source.maxLength!=7)
    {
    	var day   = source.value.substring(8,10);
    
	    if (LeapYear(year) == 1)
	    {
	        if (daytab1[month-1] < day)
	        {
	            alert("ÀÏÀÚ(ÀÏ) Çü½ÄÀÌ Æ²¸³´Ï´Ù.");
	            source.value = "";
	            source.focus();
	            return;
	        }
	    }
	    else
	    {
	        if (daytab2[month-1] < day)
	        {
	            alert("ÀÏÀÚ(ÀÏ) Çü½ÄÀÌ Æ²¸³´Ï´Ù.");
	            source.value = "";
	            source.focus();
	            return;
	        }
	    }
	    
	    if ((day < 1 || day > 31) || (day.indexOf("-") > -1))
	    {
	        alert("ÀÏÀÚ Çü½ÄÀÌ Æ²¸³´Ï´Ù.");
	        source.value = "";
	        source.focus();
	        return false;
	    }
    }
    
    if(source.maxLength==13)
    {
	    var hour   = source.value.substring(11,13);
	    
	    if (hour < 0 || hour > 24) 
	    {
	        alert("½Ã°£ Çü½ÄÀÌ Æ²¸³´Ï´Ù.");
	        source.value = "";
	        source.focus();
	        return false;
	    }
     }
	
     return 1;
}

function isDecimal(number){
	if(number >= 0 && number <= 9) return true;
	else return false;
}

function LeapYear(year)
{
	if (year % 4 == 0)
		if  (year % 100 == 0)
			 if  (year % 400 == 0)
                  return 2;
			 else return 1;
		else return 2;
	return 1;
}

var controlKeyTypingCnt = 0;

function onlyNumber( sign, scale )
{
	//alert(event.keyCode);
	if ( scale == null )
	{
		scale = false;
	}

	if( ( (event.keyCode >= 48) && (event.keyCode <= 57) ) ||
		( (event.keyCode >= 96) && (event.keyCode <= 105) )  ) {
	}
	else
	{
		if ( sign && (event.keyCode == 45 )  ) { // '-','.'Çã¿ë
      controlKeyTypingCnt= 0;
      null;
    }	else if ( scale && ( event.keyCode == 46 ) ) {
      controlKeyTypingCnt= 0;
			null;
		 } else if ( event.keyCode == 8 ){		// back space
      controlKeyTypingCnt= 0;
			null;
		} else if ( event.keyCode == 9 ){		// tab
      controlKeyTypingCnt= 0;
			null;
		} else if ( event.keyCode == 37 )	{	// left arrow <-
      controlKeyTypingCnt= 0;
			null;
		} else if ( event.keyCode == 39 ){		// right arrow ->
      controlKeyTypingCnt= 0;
			null;
		} else if ( event.keyCode == 46 )	{	// delete
      controlKeyTypingCnt= 0;
			null;
		} else if ( event.keyCode == 17 )	{	// control key
      controlKeyTypingCnt++;
			null;
		}  else if ( event.keyCode == 190 )	{	// control key
      controlKeyTypingCnt++;
			null;
		}else if ( controlKeyTypingCnt != 0 && event.keyCode == 67 )	{	// c
      controlKeyTypingCnt= 0;
			null;
		} else if ( controlKeyTypingCnt != 0 && event.keyCode == 86 )	{	// v
      controlKeyTypingCnt= 0;
			null;
		} else if ( controlKeyTypingCnt != 0 && event.keyCode == 88 ){		// x
      controlKeyTypingCnt= 0;
			null;
		} else {
      controlKeyTypingCnt= 0;
			event.returnValue=false;
    }

  }
}

function formatNumber( num, format ) {
	var numValue = num.toString();
	var rtnValue = '';
	
	var formattedPoint = format.substring( 5, 6 );
	var formattedKilloDeli = format.substring( 1, 2 );
	
	var pointIndex = numValue.indexOf( '.' );
  pointIndex = ( pointIndex != -1 ? pointIndex : numValue.length );

  var decimalValue = numValue.substring( 0, pointIndex );
	var pointValue = numValue.substring( pointIndex + 1 );

	var modulus = decimalValue.length % 3;

	var index1 = 0;
	var index2 = modulus;
	if( index2 == 0 ) {
		index2 += 3;
	}


  var i = 0 ;

	while( true ) {

		rtnValue += decimalValue.substring( index1, index2 );

		index1 = index2;
		index2 += 3;

		if( index2 > decimalValue.length ) {
			break;
		}

    rtnValue += formattedKilloDeli;
	}
  
  if( pointIndex != numValue.length ) {
	  rtnValue += formattedPoint + pointValue;
  }

	return rtnValue;
}

function toNumber( num ) {
	var rtnValue = '';

	var numValue = num.toString();

	numValue = numValue == '' ? '0' : numValue;

	for( i = 0 ; i < numValue.length ;i++ ) {
		var dd = numValue.charAt( i );

		if( dd >= '0' && dd <= '9'  || dd == '.' ) {
  		rtnValue += dd;
		}

	}

	return parseInt( rtnValue );
}

function nextFocus(obj, limitLength, nextObj) {
	if(obj.value.length == limitLength) nextObj.focus();
}

function nextFocus(nextObj) {
	nextObj.focus();
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//-- ÀÏ¹ÝÀûÀ¸·Î ´Ü¼øÇÑ ÇÃ·¡½¬ ÀÏ °æ¿ì
/*
	-- ÆÄ¶ó¹ÌÅÍ Á¤º¸ --

	width : °¡·ÎÅ©±â
	height : ¼¼·ÎÅ©±â
	url : ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
*/

function VSFlexGridView(id, name, width, height, codebase, classid){
	
	document.write("<OBJECT id='"+id+"' style='LEFT: 0px; TOP: 0px ' codeBase='"+codebase+"'  ");
	document.write("classid='clsid:"+classid+"' name='"+name+"' height='"+height+"' width='"+width+"'>  ");
	document.write("</OBJECT>  ");
}
