function openEjacket(_requstPath,_flashFilePath){

    var xPos = (window.screen.availWidth - 771)/2;
    var yPos = (window.screen.availHeight - 570)/2;

    var url = _requstPath+"?path="+_flashFilePath;
    win = window.open(url,'eJacket','toptoolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resizable=no,copyhistory=no,width=771,height=570,left='+ xPos +',top='+ yPos+'\'');
    win.focus();
}

function openEjacket2(_requstPath,_flashFilePath, album_name, album_id, artist_name, artist_id){

    var xPos = (window.screen.availWidth - 771)/2;
    var yPos = (window.screen.availHeight - 570)/2;

    var url = _requstPath+"?path="+_flashFilePath + "&album_name="+album_name+ "&album_id="+album_id+ "&artist_name="+artist_name+ "&artist_id="+artist_id;
    win = window.open(url,'eJacket','toptoolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,toolbar=no,resizable=no,copyhistory=no,width=771,height=570,left='+ xPos +',top='+ yPos+'\'');
    win.focus();
}

function popup(url, title, width, height, scroll)
{
	var xPos = (window.screen.availWidth - width)/2;
	var yPos = (window.screen.availHeight - height)/2;

	win = window.open(url,title,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scroll+',toolbar=no,resizable=no,copyhistory=no,width='+width+',height='+height+',left='+ xPos +',top='+ yPos+'\'');
	win.focus();
}


function popupAllAttr(url, title, width, height, scroll)
{
	var xPos = (window.screen.availWidth - width)/2;
	var yPos = (window.screen.availHeight - height)/2;

	win = window.open(url,title,'toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars='+scroll+',resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+ xPos +',top='+ yPos+'\'');
	win.focus();
}

function popupResizable(url, title, width, height, scroll)
{
	var xPos = (window.screen.availWidth - width)/2;
	var yPos = (window.screen.availHeight - height)/2;

	win = window.open(url,title,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scroll+',toolbar=no,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+ xPos +',top='+ yPos+'\'');
 	win.focus();
}

function getObj( form, obj )
{
    return document[getNetuiTagName(form)][getNetuiTagName(obj)];
}

function getValue( form, obj )
{
    return getObj(form, obj).value;
}

function setValue( form, obj, val )
{
    document[getNetuiTagName(form)][getNetuiTagName(obj)].value = val;
}

function ckNull( name, i )
{
    //var oO = eval( document.all[name][i] );
    var oO = ckNullOo( name, i );

    if( oO !=null&&oO.value != "undefined")
    {
        return oO.value;
    }
    else
    {
        return document.all[name].value;
    }
}

function ckNullOo( name, i)
{
    var oOb = eval( document.all[name] );

    if( oOb!=null ) {

        var oO = oOb[i];

        if( oO !=null&&oO.value != "undefined")
        {
            return oO;
        }
        else
        {
            return document.all[name];
        }
    }
}


function clipText(str, len) {
    if (str == null || str == '') return '';

	// clip½Ã Æ¯¼ö¹®ÀÚ º¯È¯
	var tmp;

	str = str.replace(/&amp;/gi, "&")
			 .replace(/&lt;/gi, "<")
			 .replace(/&gt;/gi, ">")
			 .replace(/&#39;/gi, "'")
			 .replace(/&quot;/gi, "\"")
			 .replace(/&nbsp;/gi, " ");

    if (str.length <= len) return str;

    var rValue;
	var nLength;

	nLength = 0.00;
	rValue = '';

	var tmpCode;
	var tmpStr;
	var tmpLen = 0;
	for (var i=0; i < str.length; i++) {
		tmpCode = str.charCodeAt(i);
		tmpStr = str.charAt(i);
		if (tmpCode >= 65 && tmpCode <= 90) { //Big English
			tmpLen += 0.71;
			rValue += tmpStr;
		}
		else if (tmpCode >= 97 && tmpCode <= 122) { //Small English
			tmpLen += 0.5;
			rValue += tmpStr;
		}
		else if (tmpCode > 128) { //Korean
			tmpLen += 1;
			rValue += tmpStr;
		}
		else { //Etc Symbol
			tmpLen += 0.42;
			rValue += tmpStr;
		}

		if (tmpLen >= len) {
			break;
		}
	}
    if (tmpLen > (len - 1)) {
        rValue += '...';
    }

	// return½Ã Æ¯¼ö¹®ÀÚ º¹±¸
	return rValue.replace(/&/gi, "&amp;")
				 .replace(/</gi, "&lt;")
				 .replace(/>/gi, "&gt;")
				 .replace(/'/gi, "&#39;")
				 .replace(/\"/gi, "&quot;")
				 .replace(/\s/gi, "&nbsp;");

/*
	var len = parseInt(length);
	if (text.length <= len) {
		return text;
	}
	else {
		return text.substring(0, len) + '...';
	}*/
}



/**
 * ÁÂ¿ì °ø¹é Á¦°Å trim()
 */
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

/**
 * Ã¼Å©¹Ú½º ÀüÃ¼ ¼±ÅÃ
 *        flagName   : ÀüÃ¼¼±ÅÃ checkbox ¸í(ÀÏ¹Ýhtml)
 *        formName   : Æû tagId (netui)
 *        chekboxName: checkbox tagId (netui)
 */
function checkAllSel(flagName, formName, chekboxName)
{
    var flag = eval("document.all."+flagName+".checked");
    var checkbx = document[getNetuiTagName(formName)][getNetuiTagName(chekboxName)];

    if(checkbx == null) return;

    if(checkbx.length == null)
    {
        checkbx.checked = flag;
    }
    else
    {
        for(i = 0; i < checkbx.length; i++)
        {
            checkbx[i].checked = flag;
        }
    }
}


//------------------------------- ³¯Â¥ °ü·Ã script ------------------------------------------//
//
// »ç¿ë¹æ¹ý : <input name="dd"  size="10" maxlength="8" style="ime-mode:disabled"  onKeyPress="return onlyNum()" onFocus="removeDate()" onBlur="formatDate()">
//
//  onkeypress="return onlyNum()" onfocus="removeDate()" onblur="formatDate()"
//  style="ime-mode:disabled"     <-- ÇÑ±ÛÀÏ¶§ OnkeyPress ÀÌº¥Æ®°¡ ½ºÅ©¸³Æ® ¹ö±×·Î ¹ÝÀÀÀ» ¾ÈÇÏ±â¶§¹®¿¡
//  ½ºÅ¸ÀÏ·Î ¿øÃµÀûÀ¸·Î ºÀ¼âÇÕ´Ï´Ù.
//  input box¿¡´Ù°¡ À§ÀÇ ÀÌ¹êÆ®¸¸ ¼³Á¤ÇØµÎ¸é ÀÌº¥Æ® ÀÏ¾î³­ °´Ã¼¸¦ °¡Áö°í ÇÏ±â¶§¹®¿¡ °´Ã¼¿¡ °ªÀÌ ¼ÂÆÃµË´Ï´Ù.
//
//---------------------------------------------------------------------------------------------//

var dateGuBun = '-';
var dateGuBun2 = /\-/g;
function onlyNum() {
  var keycode = event.keyCode;

  //alert("keycode = " + keycode);
  // 48->0  57->9
  if (keycode >= 48 && keycode <=57) {
	//alert("keycode = " + keycode);
    return true;
  }

   return false;
}

function removeDate() {
  var field = event.srcElement;

  var value = field.value;

  if (value == "") {
    return;
  }

  field.value = (value.replace(dateGuBun2,"")).replace(" ","");
  setFocus(field);
}

/*
 * ¼³  ¸í : ³¯Â¥ÇÊµåÀÇ YYYYMMDDÀÇ ³¯Â¥¸¦ YYYY-MM-DD·Î ¹Ù²ã ¼¼ÆÃÇÑ´Ù.
 *          onblur ÀÌº¥Æ®¿¡ »ç¿ëÇÔ.
 * ¼ö  Á¤ : isHour ¼Ó¼ºÀ» ºÎ¿©ÇÏ¿© ½Ã°£±îÁö Ç¥Çö °¡´ÉÇÏµµ·Ï ¼öÁ¤ÇÔ
 * ÀÎÀÚ 1 :
 * ¸®ÅÏ°ª :
 */
function formatDate() {
  var field = event.srcElement;

  var value = rmDate(field.value);

  if (value == "") {
    return;
  }

  if (field.isMonth == "Y") {
    if (value.length != 6) { // ÀÚ¸®¼ö Ã¼Å©(³â¿ù)
      alert("³¯Â¥°¡ Àß¸ø ÀÔ·ÂµÇ¾ú½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä. (¿¹: 200308)");
      field.value = "";
      setFocus(field);
      return;
    }

    if (!checkDate2(value)) { // ³¯Â¥ validation
      alert("Á¸ÀçÇÏÁö ¾Ê´Â ³¯Â¥ÀÔ´Ï´Ù. È®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
      field.value = "";
      setFocus(field);
      return;
    }

    field.value = plusDate2(value);
  }
  else if (field.isHour == "Y") {
    if (value.length != 10) { // ÀÚ¸®¼ö Ã¼Å©(³â¿ùÀÏ½Ã)
      alert("³¯Â¥°¡ Àß¸ø ÀÔ·ÂµÇ¾ú½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä. (¿¹: 2003080411)");
      field.value = "";
      setFocus(field);
      return;
    }

    if (!checkDate2(value.substring(0,8))) {
      alert("Á¸ÀçÇÏÁö ¾Ê´Â ³¯Â¥ÀÔ´Ï´Ù. È®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
      field.value = "";
      setFocus(field);
      return;
    }

    var tmpTime = new Number(value.substring(8,10));
    if (tmpTime >= 24) {
      alert("½Ã°£Àº 23½Ã±îÁö¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù. È®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
      field.value = "";
      setFocus(field);
      return;
    }

    field.value = plusDate(value) + " " + value.substring(8,10);
  }
  else {
    if (value.length != 8) { // ÀÚ¸®¼ö Ã¼Å©
      alert("³¯Â¥°¡ Àß¸ø ÀÔ·ÂµÇ¾ú½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä. (¿¹: 20030809)");
      field.value = "";
      setFocus(field);
      return;
    }

    if (!checkDate(value)) { // ³¯Â¥ validation
      alert("Á¸ÀçÇÏÁö ¾Ê´Â ³¯Â¥ÀÔ´Ï´Ù. È®ÀÎ ÈÄ ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
      field.value = "";
      setFocus(field);
      return;
    }

    field.value = plusDate(value);
  }

}

/*
 * ¼³  ¸í : YYYYMMDDÀÇ ³¯Â¥¸¦ YYYY-MM-DD·Î ¹Ù²Û ÈÄ ¸®ÅÏÇÑ´Ù.
 * ÀÎÀÚ 1 : value - 8ÀÚ¸® ³¯Â¥
 * ¸®ÅÏ°ª : format µÈ 10ÀÚ¸® ³¯Â¥
 */
function plusDate(value) {
  if (value == "") {
    return value;
  }

  var yyyy = value.substring(0, 4);
  var   mm = value.substring(4, 6);
  var   dd = value.substring(6, 8);

  return yyyy + dateGuBun + mm + dateGuBun + dd;
}


/*
 * ¼³  ¸í : YYYY-MM-DD Çü½ÄÀÇ ³¯Â¥ÀÇ validation.
 * ÀÎÀÚ 1 : value - ³¯Â¥
 * ¸®ÅÏ°ª : boolean - ¿Ã¹Ù¸¥ ³¯Â¥¸é true, ¾Æ´Ï¸é false
 */
function checkDate(value) {
  var yyyy = eval(value.substring(0, 4));
  var   mm = eval(value.substring(4, 6));
  var   dd = eval(value.substring(6, 8));

  var date = new Date(yyyy, mm-1, dd);

  if (yyyy != date.getFullYear() ||
        mm != (date.getMonth()+1) ||
        dd != date.getDate()) {
    return false;
  }

  return true;
}

/*
 * ¼³  ¸í : YYYY-MM-DDÀÇ ³¯Â¥¸¦ YYYYMMDD·Î ¹Ù²Û ÈÄ ¸®ÅÏÇÑ´Ù.
 * ÀÎÀÚ 1 : value - 10ÀÚ¸® ³¯Â¥
 * ¸®ÅÏ°ª : formatÀÌ Á¦°ÅµÈ 8ÀÚ¸® ³¯Â¥
 * ¼ö  Á¤ : isHour ¼Ó¼ºÀ» ºÎ¿©ÇÏ¿© ½Ã°£±îÁö Ç¥Çö °¡´ÉÇÏµµ·Ï ¼öÁ¤ÇÔ
 */
function rmDate(value) {
  return (value.replace(dateGuBun2,"")).replace(" ","");
}

/*
 * ¼³  ¸í : ÀÔ·Â¹ÞÀº ÇÊµå·Î Æ÷Ä¿½º¸¦ ¿Å±ä´Ù.
 * ÀÎÀÚ 1 : field - ÇÊµå°´Ã¼
 * ¸®ÅÏ°ª :
 */
function setFocus(field) {
  try {
    if (field.type == "text") {
      if (field.value != '') {
        field.select();
      }
      else {
        field.focus();
      }
    }
    else {
      field.focus();
    }
  } catch (e) { }
}

//----------------------------------------- End =-------------------------------------------------------------------//


/*
 * ¼³  ¸í : ¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏÀÎÁö Ã¼Å©ÇÑ´Ù.
 * ÀÎÀÚ 1 : src - Ã¼Å©ÇÒ ÀÌ¸ÞÀÏ ½ºÆ®¸µ
 * ¸®ÅÏ°ª : true / false
 * »ý¼ºÀÏ : 2005.11.24
 */
function checkIsValidEmail(field) {
	if (field.value.search(/(\S+)@(\S+)\.(\S+)/) == -1 ) {
		//alert("Á¤È®ÇÑ ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä")
		//setFocus(field);
		return false;
	}

	return true;
}

/**
  * ¼³¸í : µé¾î¿Â Object°¡ ¹è¿­ÀÎÁö¸¦ ±¸º°ÇÑ´Ù.
  * param : obj - Ã¼Å©ÇÒ Object
  * return : boolean. ¹è¿­ÀÎ°æ¿ì true, ¾Æ´Ï¸é false¸¦ ¹ÝÈ¯ÇÑ´Ù.
  * »ý¼ºÀÏ : 2005.11.24
  */
function isArray(obj) {
	return(typeof(obj.length)=="undefined") ? false : true;
}



    //ÇÑ±Û 2±ÛÀÚ ¿µ¹® 1±ÛÀÚ·Î ±æÀÌ ÃøÁ¤ÇÏ¿© ÃÖ´ë ±æÀÌ ÀÌ»óÀÌ¸é alert¸¦ ¶ç¿ì°í Àß¶ó³½´Ù.
    function checkStrLength(textObj, length_limit)
	{
		var comment = textObj;
		var length = calculate_msglen(comment.value);
		var kor_cnt = Math.floor(length_limit/2);
		if (length > length_limit) {
			alert("ÇÑ±Û "+ kor_cnt + "ÀÚ, ¿µ¹® " +length_limit + "ÀÚ¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			comment.value = comment.value.replace(/\r\n$/, "");
			comment.value = assert_msglen(comment.value, length_limit);
			comment.focus();
		}
	}
	//À§¿Í °°Àº ·ÎÁ÷ÀÌÁö¸¸ onkeydown(), onkeypress(), onkeyup()À» »ç¿ëÇÒ¶§ Á¤ÇØÁø ¹ÙÀÌÆ® ¼ö¸¸Å­ Àß¶óÁÖ´Â
    //ºÎºÐÀÇ Å¸ÀÌ¹ÖÀÌ Á» ´Ù¸£±â¶§¹®¿¡ ¼Ò½º ¼öÁ¤....
    function checkStrLength(textObj, length_limit, cut_length)
	{
		var comment = textObj;
		var length = calculate_msglen(comment.value);
		var kor_cnt = Math.floor(length_limit/2);

		if (length + 1 > length_limit) {
			alert("ÇÑ±Û "+ kor_cnt + "ÀÚ, ¿µ¹® " +cut_length + "ÀÚ¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			comment.value = comment.value.replace(/\r\n$/, "");
			comment.value = assert_msglen(comment.value, cut_length);
			comment.focus();

			return false;
		}
	}

    //¹®ÀÚ¿­ÀÇ byte ±æÀÌ¸¦ ¸®ÅÏÇÑ´Ù.
	function calculate_msglen(message)
	{
		var nbytes = 0;

		for (i=0; i<message.length; i++) {
			var ch = message.charAt(i);
			if(escape(ch).length > 4) {
				nbytes += 2;
			} else if ( ch == '¡¤' ) {
				nbytes += 2;
			} else if (ch == '\n') {
				if (message.charAt(i-1) != '\r') {
					nbytes += 1;
				}
//			} else if (ch == '<' || ch == '>') {
//				nbytes += 4;
			} else {
				nbytes += 1;
			}
		}

		return nbytes;
	}

    //ÇØ´ç ±æÀÌ(byte)¸¸Å­ ¹®ÀÚ¿­À» Àß¶ó³½ ÈÄ ¸®ÅÏÇÑ´Ù.
	function assert_msglen(message, maximum)
	{
		var inc = 0;
		var nbytes = 0;
		var msg = "";
		var msglen = message.length;

		for (i=0; i<msglen; i++) {
			var ch = message.charAt(i);
			if (escape(ch).length > 4) {
				inc = 2;
			} else if ( ch == '¡¤' ) {
				inc = 2;
			} else if (ch == '\n') {
				if (message.charAt(i-1) != '\r') {
					inc = 1;
				}
//			} else if (ch == '<' || ch == '>') {
//				inc = 4;
			} else {
				inc = 1;
			}
			if ((nbytes + inc) > maximum) {
				break;
			}
			nbytes += inc;
			msg += ch;
		}
		return msg;
	}


    //°ø¹é ½ºÆ®¸µ Ã¼Å©
    function isEmpty(s){
	   return ((s == null) || (s.length == 0));
    }

	var whitespace = " \t\n\r";

    //ÀÎÀÚ·Î ³Ñ¾î¿Â ¹®ÀÚ¿­ÀÌ °ø¹éÀÎÁö Ã¼Å©
	function isWhitespace(s){
       if (isEmpty(s)) return true;
       for (var i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
       }
   		return true;
	}

    	//Ã¼Å©¹Ú½º°¡ ¼±ÅÃµÇ¾ú´ÂÁö È®ÀÎÇÑ´Ù.
	function isChecked() {
	    var form = arguments[0]; //form object
	    var msg  = arguments[1]; //message

	    if(msg==null) msg = "Ã¼Å©¹Ú½º¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä";
	    var chk = 0;

	    for(var i = 0; i < form.elements.length ; i++) {
	       if ((form.elements[i].type == "checkbox") && (form.elements[i].checked == true)) {
	           chk++;break;
	       }
	    }

	    if (chk == 0 ) {
	    	alert(msg);
	    	return false;
	    } else {
	    	return true;
	    }
	}

	//¼±ÅÃµÈ ¶óµð¿À¹öÆ°ÀÇ °ªÀ» ¾ò´Â´Ù.
	function getChekcedValue(chkObj){

		var radio = getObjArray(chkObj);
		var val = "";
		for(i=0; i<radio.length; i++){
			if(radio[i].checked){
				val = radio[i].value;
				break;
			}
		}

		return val;
	}

	function isRadioChecked(chkObj){
		var radio = getObjArray(chkObj);
		for(i=0; i<radio.length; i++){
			if(radio[i].checked){
				return true;
			}
		}

		return false;
	}

    /*
	 * °´Ã¼¸¦ ÀÎÀÚ·Î ¹Þ¾Æ array·Î ¸¸µé¾î¼­ ¸®ÅÏÇÑ´Ù
	 * ÀÎÀÚ°¡ ¿ø·¡ array ÀÌ¸é ±×´ë·Î ¸®ÅÏÇÏ°í, ¾Æ´Ï¸é Å©±â°¡ 1ÀÎ array·Î ¸¸µé¾î ¸®ÅÏÇÑ´Ù.
	 */
	function getObjArray(oneOrArray){

		if(oneOrArray==null) return null;
		else if(oneOrArray.length >= 1){
			return oneOrArray;
		}else{
			var newArray = new Array(1);
		    newArray[0]  = oneOrArray;
			return newArray;
		}

	}

var listMethod = "doList";//List Action

/**
 * method for create, update, delete
 */
function submitCommand( targetMethod )
{
		form1.targetMethod.value=targetMethod;
		ValidateForm();
}

/**
 * method for paging inquery
 */
function goSearch( command,_page ) {
		with ( form1 ) {
			if( command == 'my_v.MyPointSaveList.pcweb' || command == 'my_v.MyPointSaveList.web'
				 || command == 'my_v.MyPointUseList.pcweb' || command == 'my_v.MyPointUseList.web' ) {
			} else {
				reset();
			}
				if( _page != null && _page !="" ) {
						page.value=_page;
				}
				action = command; //"packageName.ClassName.exe";
				//targetMethod.value=listMethod;
				target = "";
				document.form1.submit();
		}
}


function goCreate(command) {

	with (form1) {
		action = command; //"packageName.ClassName+Create.exe";
		document.form1.spiderSubmit();
	}
}


function goCreateForm(command) {
	with (form1) {
		action = command; //"packageName.ClassName+List.exe";
		document.form1.submit();
	}
}

/**
 * component create for year, month, day select box in calandar
 * Create at this position to called
 * <br>ex : makeDateSelectBox("20060822","yyyy","mm","dd")
 * @param now : today date
 * @param year : year selectbox name
 * @param month : month selectbox name
 * @param date : day selectbox  name
 */
function makeDateSelectBox(now,year,month,date)
{
        var nYear = now.substring(0,4);
        var sYear = parseInt(nYear,10) - 4;
        var eYear = parseInt(nYear,10) + 4;
        var nMonth = now.substring(4,6);
        var nDate = now.substr(6);

        document.write(makeSelectBoxString(year,"onChangeLeapDate(form1."+year+",form1."+month+",form1."+date+")","select1",sYear,eYear,nYear));
        document.write("Year");
        document.write(makeSelectBoxString(month,"onChangeLeapDate(form1."+year+",form1."+month+",form1."+date+")","select1",1,12,nMonth));
        document.write("Month");
        document.write(makeSelectBoxString(date,"","select1",1,findLeapEndDate(nYear, nMonth),nDate));
        document.write("Day");
}


/**
 * year, monty == day select box option create.
 * <br>ex : onChangeLeapDate(form1.year,form1.month,form1.date)
 * @param year : form name.object name of year infomation object
 * @param month : form name.object name of month infomation object
 * @param date : form name.object name of day infomation object
 */
function onChangeLeapDate(year,month,date) {

        var i = 1;
        var k = 1;
        date.length = findLeapEndDate(year.value, month.value);
          var total_days = date.length;
        for (i=1 ;i <= total_days;i++) {
                k = i;
                if(i < 10) k = '0' + k;
                date.options[i-1].text=k;
                date.options[i-1].value=k;
        }

}


/**
 * select box create. date and number used
 * <br>ex : makeSelectBoxString("YYYY","onChangeLeapDate(form1.year,form1.month,form1.date)","select1",1,12,8)
 * @param name : select box obect name for create
 * @param onchange : event control javascript method to use onChange event
 * @param classname : css class name to use select box
 * @param startNo : start value
 * @param endNo : end value
 * @param selectedValue : default value
 * @return select box String to created
 */
function makeSelectBoxString(name,onchange,classname,startNo,endNo,selectedValue)
{
        if(!onchange == "")
        {
                onchange = 'onChange="'+onchange+'"';
        }
        if(!classname == "")
        {
                classname = 'class="'+classname+'"';
        }
        var str = '<select '+classname+' name="'+name+'"'+ onchange+'>';
        for(;startNo <= endNo ; startNo++)
        {
                if(startNo == selectedValue)
                {
                        if(startNo < 10) {startNo = '0'+startNo;}
                        str += '<option value="'+startNo+'" selected>'+startNo;
                } else
                {
                        if(startNo < 10) {startNo = '0' + startNo;}
                        str += '<option value="'+startNo+'">'+startNo;
                }
        }
        str += '</select>';
        return str;

}


/**
 * final day find of year and month
 * <br>ex : findLeapEndDate("2006", "2")
 * @param year : year value
 * @param month : month value
 * @return final day of year and month
 */
function findLeapEndDate(year, month) {
          year  = parseInt(year,10);
        month = parseInt(month,10);

          var endDay=31;
        if(month == 2) {
                if(( (year % 4 == 0) && (year % 100 != 0) ) || ( year % 400 == 0 ) ) {
                        endDay = 29;
                }
                else {
                        endDay = 28;
                }
        }
        else if( (month == 4) || (month == 6) || (month == 9) || (month == 11) ) {
                endDay = 30;
        }
        else {
                endDay = 31;
        }
          return endDay;
}


/**
 * Display Line click event
 * <br>ex : displayOnChange()
 */
function displayOnChange() {

	document.form1.spiderSubmit();
}

/**********************************************************************************
 * Title      : Å°¸¦ ´­·¶À» ¶§ Ã³¸® Method(enter¿Í focus Ã³¸®)
 * Dreciption : obj1¿¡¼­ len¸¸Å­ÀÇ stringÀ» ÀÔ·ÂÇßÀ» ¶§ obj2·Î focusº¯°æÇØÁØ´Ù.
 * Input Date : 2007-02-27
 * Return Data Type :
 * Parameter Type   : input object, input object, int
 * Example : key_check(input object("20030101"), input object("20030101"), 10) -> input object focus ÀÌµ¿
 **********************************************************************************/
 function key_check(obj1, obj2, len){
	var keyCode = (window.event.keyCode);

	if(keyCode  == 13){
		GoURL('search');
	}else{
		if(keyCode != 9 && keyCode != 16 && keyCode != 37 && keyCode != 38 && keyCode != 39 && keyCode != 40){
			if(obj1.value.length == len){
				obj2.focus();
			}
		}
	}
}

/******************************************************
 *  Function¸í : ThousandWonCut(obj)
 *  ¼³      ¸í : ÀÔ·Â¹ÞÀº °ªÀÇ Ãµ¿øÀÌÇÏ ±Ý¾×Àº Àý»èÇÔ
 *  Parameter  : obj : ±Ý¾× or ½ºÆ®¸µ ±Ý¾×
 *  Return     : Ãµ¿øÀý»èµÈ ±Ý¾×
 *  ºñ      °í : 333,434 -- 333,000ÇüÅÂ·Î º¯°æ
 ******************************************************/
function ThousandWonCut(obj){
    var amt = obj.value;
    amt = NUremoveComma(amt);
    if(amt>1000){
        amt = amt - (amt%1000);
    }

    obj.value = amt;
    amt = NUaddComma(obj);
}

/******************************************************
 *  Function¸í : NUaddComma(obj)
 *  ¼³      ¸í : ÀÔ·Â¹ÞÀº °ª¿¡´Ù ÄÞ¸¶¸¦ ³Ö´Â´Ù.
 *  Parameter  : obj : ¼ýÀÚ½ºÆ®¸µ or ½ºÆ®¸µ °´Ã¼
 *  Return     : ÄÞ¸¶ Æ÷ÇÔ ½ºÆ®¸µ
 *  ºñ      °í : 12345.22 -- 12,345.22ÇüÅÂ·Î º¯°æ
 ******************************************************/
function NUaddComma(obj) {

	var txtNumber = NUremoveComma(obj);

	var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
	var arrNumber = txtNumber.split('.');

	arrNumber[0] += '.';

	do {
		arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
	} while (rxSplit.test(arrNumber[0]));

	if (arrNumber.length > 1) {
		if(obj == '[object]') {
			obj.value = arrNumber.join('');
		}
		return arrNumber.join('');
	} else {
		if(obj == '[object]') {
			obj.value = arrNumber[0].split('.')[0];
		}
		return arrNumber[0].split('.')[0];
    }
}

/******************************************************
 *  Function¸í : NUremoveComma(obj)
 *  ¼³      ¸í : ÀÔ·Â¹ÞÀº °ª¿¡´Ù ÄÞ¸¶¸¦ »èÁ¦ÇÑ´Ù.
 *  Parameter  : obj : ¼ýÀÚ½ºÆ®¸µ or ½ºÆ®¸µ °´Ã¼
 *  Return     : ÄÞ¸¶ »« ½ºÆ®¸µ
 *  ºñ      °í : 12,345.22 -- 12345.22 ÇüÅÂ·Î º¯°æ
 ******************************************************/
function NUremoveComma(obj) {
	var want_val = '';

	var resultVal = '';

	if(obj == '[object]')      // obj°¡ Object¸é
		resultVal = obj.value;
	else
		resultVal = obj;

	if (resultVal.length < 1) {
		if(obj == '[object]')      // obj°¡ Object¸é
		obj.value = want_val;

		return want_val;
	}

	//°ªÀÌ Á¸ÀçÇÏ¿©¾ß¸¸ ¿¬»êÀ» ¼öÇàÇÔ

	if (resultVal.length != 0) {
		//<,>´ÜÀ§ÀÇ Ç¥±â¹ýÀ» ¿¬»ê Çü½ÄÀ¸·Î º¯È¯
		for(var i=0; i < resultVal.length; i++) {
			var digit = resultVal.charAt(i);   //i ÀÌÀüÀÇ ¹®ÀÚ¸¦ ¹Ý¿µÇÑ´Ù

			if(digit != ",")                   //<,>°¡ ¾Æ´Ñ ¹®ÀÚ´Â ´©Àû
			want_val = want_val + digit;
		}
	}

	if(obj == '[object]') {      // obj°¡ Object¸é
		obj.value = want_val;
	}

	return want_val;
}

/******************************************************
 * Function¸í : NUonlyNo()
 * ¼³      ¸í : ÀÔ·ÂÇÊµå¿¡¼­ ¿ÀÁ÷ ¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÏ°Ô ÇÑ´Ù.
 *							È£ÃâÀº OnKeyDownÀ¸·Î ÇÑ´Ù.(OnKeyPress´Â
 *							ÇÑ±ÛÀÔ·Â½Ã Àû¿ëÀÌ ¾ÈµÈ´Ù.)
 * Return     : void
 ******************************************************/
function NUonlyNo() {
	var keycode = event.keyCode;

	if( (keycode>=48&&keycode<=57) ||
			(keycode==8||keycode==9||keycode==46) ||
			(keycode>=96&&keycode<=105) ||
			(keycode>=35&&keycode<=40) ||
			(event.ctrlKey)||(keycode==67||keycode==86) ) {
		if(!(event.ctrlKey) && (keycode==67||keycode==86))	//ctrlÅ°¸¦ ´©¸£Áö ¾ÊÀº »óÅÂ¿¡¼­ c¶Ç´Â vÅ°¸¦ ´©¸£´Â °æ¿ì
			event.returnValue=false;
		else
			event.returnValue=true;	//±×¿ÜÀÇ Á¤»óÀûÀÎ ÀÔ·Â»óÈ²
	} else {
		event.returnValue=false;
	}
}

//////////////////////////////////////////////////////////////////////////////
//  ´Ü°î µè±â
//////////////////////////////////////////////////////////////////////////////
function SinglePlay(pId)
{
	if (pId == ""){
		alert("¼±ÅÃÇÑ °îÀÌ ¾ø½À´Ï´Ù.")
	} else {
		top.hiddenFrame.location.href = "/musicon/player.QupPlayer.web?pId="+pId+"&play_flag=selectPlay";//,"hiddenFrame","left=0, top=0, location=0, toolbar=no, directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width=355,height=140");
	}
}

//////////////////////////////////////////////////////////////////////////////
//  ´Ü°î µè±â(°¡»çº¸±â ÆË¾÷Ã¢¿¡¼­ °î µæ±â ¿äÃ»½Ã¿¡¸¸ »ç¿ë)
//////////////////////////////////////////////////////////////////////////////
function SinglePlayForLyric(pId)
{
	if (pId == ""){
		alert("¼±ÅÃÇÑ °îÀÌ ¾ø½À´Ï´Ù.")
	} else {
		opener.top.hiddenFrame.location.href = "/musicon/player.QupPlayer.web?pId="+pId+"&play_flag=selectPlay";//,"hiddenFrame","left=0, top=0, location=0, toolbar=no, directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width=355,height=140");
	}
}

//////////////////////////////////////////////////////////////////////////////
// ¼±ÅÃµÈ À½¿ø ¸®½ºÆ® µè±â
//////////////////////////////////////////////////////////////////////////////
function SelectPlay(formName)
{
	var musicIdxList = "";
	var f = document.form1;

	if (formName)
	{
		f = eval("document." + formName);
		if (!f)
		{
			alert("Á¸ÀçÇÏÁö ¾Ê´Â  form ¸í ÀÔ´Ï´Ù.\n\n" + formName);
			return;
		}
	}
	pId = f.pId;

	for (i=0; i < pId.length; i++)
	{
		if(pId[i].checked) {
			musicIdxList = musicIdxList + pId[i].value + ",";
		}
	}

	if(musicIdxList == undefined || (musicIdxList == '' && (pId.value ==undefined || pId.value == null ))) {
		alert("¼±ÅÃµÈ °îÀÌ ¾ø½À´Ï´Ù.");
		return false;
	}

	if(pId==""){
		alert("Àç»ýÇ×¸ñÀÌ ¾ø½À´Ï´Ù.")
	}else if(musicIdxList.length > 0) {
		f.action = "/musicon/player.QupPlayer.web?play_flag=checkPlay";
		f.target="hiddenFrame";
		f.submit();
	}else {
		top.hiddenFrame.location.href = "/musicon/player.QupPlayer.web?pId="+pId.value+"&play_flag=selectPlay";//,"hiddenFrame","left=0, top=0, location=0, toolbar=no, directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width=355,height=140");
	}
}

//////////////////////////////////////////////////////////////////////////////
// ¸ðµç À½¿ø ¸®½ºÆ® µè±â
//////////////////////////////////////////////////////////////////////////////
function AllPlay(formName)
{
	var musicIdxList = "";
	var f = document.form1;
	if (formName)
	{
		f = eval("document." + formName);
		if (!f)
		{
			alert("Á¸ÀçÇÏÁö ¾Ê´Â  form ¸í ÀÔ´Ï´Ù.\n\n" + formName);
			return;
		}
	}
	pId =  f.pId;

	/*
	if(pId == undefined) {
		alert("¼±ÅÃµÈ °îÀÌ ¾ø½À´Ï´Ù.");
		return false;
	}

	for (i=0; i < pId.length; i++)
	{
		musicIdxList = musicIdxList + pId[i].value + ",";
	}
	*/
	for (i=0; i < pId.length; i++)
	{
		if((pId[i].type.toLowerCase() != "checkbox") || pId[i].checked) {
			musicIdxList = musicIdxList + pId[i].value + ",";
		}
	}

	if(musicIdxList == undefined || (musicIdxList == '' && (pId.value ==undefined || pId.value == null ))) {
		alert("Àç»ýÇ×¸ñÀÌ ¾ø½À´Ï´Ù.");
		return false;
	}
	if(pId==""){
		alert("Àç»ýÇ×¸ñÀÌ ¾ø½À´Ï´Ù.")
	}else if(musicIdxList.length > 0) {
		f.action = "/musicon/player.QupPlayer.web?play_flag=selectAll";
		f.target = "hiddenFrame";
		f.submit();
	}else {
		top.hiddenFrame.location.href = "/musicon/player.QupPlayer.web?pId="+pId.value+"&play_flag=selectPlay";//,"hiddenFrame","left=0, top=0, location=0, toolbar=no, directories=no,status=no,menubar=no,scrollbars=no,resizable=no, width=355,height=140");
	}

}

/*********************************************************************************

	review ÇÔ¼ö : ÃßÃµÀ½¾Ç ¾Ù¹ü¸®ºä »ó¼¼ ÆäÀÌÁö »ó¼¼³»¿ë °ü·Ã ºÎºÐ

*********************************************************************************/

function review(){
	if (document.all["review_close"].style.display == "none")
	{
	   document.all["review_open"].style.display = "none";
		 document.all["review_close"].style.display = "";
	}
	else{
	   document.all["review_open"].style.display = "";
		 document.all["review_close"].style.display = "none";
	}
}

function review_show(){
	if (document.all["review_open"].style.display == "none")
	{
	   document.all["review_open"].style.display = "";
		 document.all["review_close"].style.display = "none";
	}
}

function review_hide(){
	if (document.all["review_close"].style.display == "none")
	{
	   document.all["review_open"].style.display = "none";
		 document.all["review_close"].style.display = "";
	}
}

	function init(width, height){
		var xPos = (window.screen.availWidth - width)/2;
		var yPos = (window.screen.availHeight - height)/2;
		
        self.resizeTo(width, height);
        self.moveTo(xPos,yPos);
    }
    
function threedHeight(vars){
  storeSub.height     = vars;
  threedpMenu.height  = vars;
}  

function na_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
  PARAMETER     : friendCustNo   °ü½ÉÄ£±¸¸¦ µî·ÏÇÒ À¯Á® CustNo
                  friendUserId   °ü½ÉÄ£±¸¸¦ µî·ÏÇÒ À¯Á® UserId
  DESC          : web¿¡¼­ »ç¿ë
*/
function doMyFriend(friendCustNo,friendUserId){
	popup('musicon/community.quppy.QuppyMyFriendCreatePopup.web?friendCustNo='+friendCustNo+'&friendUserId='+friendUserId, 'friendPopup', '455', '260', 'auto');
}

/*
  ¼³¸í          : °ü½ÉÄ£±¸ Ãß°¡ Function
  PARAMETER     : friendCustNo   °ü½ÉÄ£±¸¸¦ µî·ÏÇÒ À¯Á® CustNo
                  friendUserId   °ü½ÉÄ£±¸¸¦ µî·ÏÇÒ À¯Á® UserId
  DESC          : PcMgr web¿¡¼­ »ç¿ë
*/
function doMyFriendPcMgr(friendCustNo,friendUserId){
	popup('musicon/community.quppy.QuppyMyFriendCreatePopup.pcweb?friendCustNo='+friendCustNo+'&friendUserId='+friendUserId, 'friendPopup', '455', '260', 'auto');
}

/*
  ¼³¸í          : °ü½É¾ÆÆ¼½ºÆ® Ãß°¡ Function
  PARAMETER     : AristId        °ü½É¾ÆÆ¼½ºÆ®¸¦ µî·ÏÇÒ Artist Id
                  AristName      °ü½É¾ÆÆ¼½ºÆ®¸¦ µî·ÏÇÒ Artist Name
  DESC          : web¿¡¼­ »ç¿ë
*/
function doMyArtist(artistId,artistName){
	popup('musicon/community.quppy.QuppyMyArtistCreatePopup.web?artistId='+artistId+'&artistName='+artistName, 'artistPopup', '455', '260', 'auto');
}

/*
  ¼³¸í          : °ü½É¾ÆÆ¼½ºÆ® Ãß°¡ Function
  PARAMETER     : AristId        °ü½É¾ÆÆ¼½ºÆ®¸¦ µî·ÏÇÒ Artist Id
                  AristName      °ü½É¾ÆÆ¼½ºÆ®¸¦ µî·ÏÇÒ Artist Name
  DESC          : web¿¡¼­ »ç¿ë
*/
function doMyArtistPcMgr(artistId,artistName){
	popup('musicon/community.quppy.QuppyMyArtistCreatePopup.pcweb?artistId='+artistId+'&artistName='+artistName, 'artistPopup', '455', '260', 'auto');
}

/*
  ¼³¸í          : QUPPY°¡±â Ãß°¡ Function
  PARAMETER     : friendCustNo   QUPPY°¡±â¸¦ µî·ÏÇÒ À¯Á® CustNo
                  friendUserId   QUPPY°¡±â¸¦ µî·ÏÇÒ À¯Á® UserId
  DESC          : web¿¡¼­ »ç¿ë
*/
function goQuppyHome(quppyCustNo,quppyUserId){
	popup('musicon/community.quppy.QuppyCheck.web?quppyCustNo='+quppyCustNo+'&quppyUserId='+quppyUserId, 'friendPopup', '455', '260', 'auto');


}

/*
  ¼³¸í          : QUPPY°¡±â Ãß°¡ Function
  PARAMETER     : friendCustNo   QUPPY°¡±â¸¦ µî·ÏÇÒ À¯Á® CustNo
                  friendUserId   QUPPY°¡±â¸¦ µî·ÏÇÒ À¯Á® UserId
  DESC          : PcMgr web¿¡¼­ »ç¿ë
*/
function goQuppyHomePcMgr(friendCustNo,friendUserId){
	popup('musicon/community.quppy.QuppyCheck.pcweb?quppyCustNo='+quppyCustNo+'&quppyUserId='+quppyUserId, 'friendPopup', '455', '260', 'auto');
}

function inputCheckSpecial(obj){

	
	var strobj = eval("document." + obj);

	re = /[~!@\#$%^&*\()\-=+_']/gi;

	if(re.test(strobj.value)){

		strobj.value=strobj.value.replace(re,"");
		strobj.focus();

		var msg = "Æ¯¼ö¹®ÀÚ´Â ÀÔ·ÂÇÏ½Ç¼ö ¾ø½À´Ï´Ù.";
		popup('/musicon/jsp/include/MessagePopup.jsp?msg='+msg, 'message' , '354' ,'185' ,'no');

		return false;

	}

	return true;

}


/*
  ¼³¸í          : ÂÊÁöº¸³»±â  Function
  PARAMETER     : custNo    À¯Á® CustNo
                  loginId    À¯Á® UserId
                  userName    À¯Á® UserName
  DESC          : web¿¡¼­ »ç¿ë
*/
function doSendPaper(custNo, loginId, userName){
	var url = "/musicon/my_v.MyPaperReplyPopUp.web?pSendId="+loginId+"&pSendNo="+custNo+"&pSendName="+userName;
	var title = "´äÀåº¸³»±â";
	var width = 455;
	var height = 408;
	popup(url, title, width, height, 'auto');
}
