	/////////////////////////////////////////////////////////////
   function trim(str) {
	  if(str == null) return "";

      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 ;   
   }
   
	function replace(str,s,d){
		var i=0;

		i = str.indexOf(s);
		while(i > -1){					
			str = str.substr(0,i) + d + str.substr(i+1,str.length);
			i = str.indexOf(s);
		}
		return str;
	}


	var box_name;
	var check = 'F';
	var IE = document.all?true:false; 
	if (!IE) document.captureEvents(Event.MOUSEMOVE) 
	var tempX = 0; 
	var tempY = 0; 

	function searchCalendar(i){	

		getMouseXY(event);

		CalTable.style.left = tempX; 
		CalTable.style.top = tempY-70; 

		/*
		var width  = 183;
		var height = 205;
		var x = (screen.width - width) / 2;
		var y = (screen.height - height) / 2;

		open("../calendar.jsp?form_name=myform&box_name="+ i +"&gubun=.", "","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,left="+ x +",top="+ y +",width="+ width +",height="+ height +"");
		*/
		box_name = i;

		if(check == 'T') {
			CalTable.style.display = "none";
			check = 'F';
		} else {
			CalTable.style.display = "block";
			check = 'T';
		}

	}


	function getMouseXY(event) { 

		if(event == null) {
			tempX = 290;
			tempY = 90;
			return;
		}

		if (IE) { 
			tempX = event.clientX + document.body.scrollLeft; 
			tempY = event.clientY + document.body.scrollTop; 
		} 
		else {  
			tempX = e.pageX; 
			tempY = e.pageY; 
		}   

		if (tempX < 0){tempX = 0;} 
		if (tempY < 0){tempY = 0;}   

		return true; 
	} 


	function isControlKey() {
		var key = event.keyCode;

		return (
			   key ==   8  // <BS>
			|| key ==   9  // <Tab>
			|| key ==  13  // <Enter>
			|| key ==  35  // <End>
			|| key ==  36  // <Home>
			|| key ==  37  // <¡ç>
			|| key ==  39  // <¡æ>
			|| key ==  46  // <Del>
			|| key == 144  // <NumLock>
		);
	}

	function isDigitKey() {
		var key = event.keyCode;
		return ( key >= 48 && key <= 57 ) || ( key >= 96 && key <= 105 );
	}

	function checkNumber(limit) {
		if ( isControlKey() ) {
			event.returnValue = true;
			return ;
		}

		var key = event.keyCode;
		var str = event.srcElement.value;

		var intLengthValid = true;

		if ( limit != undefined ) {
			intLengthValid = removeChar(str, ',').length < limit;
		}

		event.returnValue = intLengthValid && isDigitKey();
	}

    String.prototype.trim = function()
    {
      return this.replace(/(^\s*)|(\s*$)/gi, "");
    }

    String.prototype.replaceAll = function(str1, str2)
    {
      var temp_str = "";

      if (this.trim() != "" && str1 != str2)
      {
        temp_str = this.trim();

        while (temp_str.indexOf(str1) > -1)
        {
          temp_str = temp_str.replace(str1, str2);
        }
      }

      return temp_str;
    }