

//ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å©
function checkJumin(form_name1,form_name2) 
{
	var formvalue = form_name1.value + form_name2.value;
	var result;
	var sum = 0;
	var temp = 2;
	for(var i = 0; i <= 11; i++) {
		sum += parseInt(formvalue.substr(i,1))*temp;
		temp++;
		if(temp == 10) {
			temp = 2;
		}
	}
	result = parseInt(sum) % 11;
	result = (11 - result) % 10;
	if (result != formvalue.substr(12,1)) {
		return false;
	} else {
		return true;
	}

	return true;
}

//»ç¾÷ÀÚµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å©(¼ýÀÚ10ÀÚ¸®)
function checkBiz(vencod) 
{ 
	var sum = 0; 
	var getlist = new Array(10); 
	var chkvalue =new Array("1","3","7","1","3","7","1","3","5");  

	try
	{
		for(var i=0; i<10; i++) 
		{ 
			getlist[i] = vencod.substring(i, i+1); 
		}         

		for(var i=0; i<9; i++) 
		{ 
			sum += getlist[i]*chkvalue[i]; 
		}  

		sum		= sum + parseInt((getlist[8]*5)/10); 
		sidliy	= sum % 10; 
		sidchk	= 0;        

		if(sidliy != 0)
		{ 
			sidchk = 10 - sidliy; 
		} 
		else 
		{
			sidchk = 0; 
		}         

		if(sidchk != getlist[9]) 
		{ 
			return false; 
		} 

		return true; 
	}
	catch(e)
	{
		return false;
	}
}

//HTMLÁ¦°Å ÇÔ¼ö
function trimHTML(strHtml){
	var objRegExp = new RegExp("<html(.*|)<body([^>]*)>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("</body(.*)</html>(.*)","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("<[/]*(div|layer|body|html|head|meta|form|input|select|textarea|base|font|br|p|b|img|embed|object|span|table|tbody|tr|td|embed|u|a|strong|li|em|col|bgsound|script|center|h1|hr|o:p)[^>]*>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("<(style|script|title|link)(.*)</(style|script|title)>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("<[/]*(scrit|style|title|xmp)>","gi");
	strHtml = strHtml.replace(objRegExp,"");

	var objRegExp = new RegExp("&nbsp;","gi");
	strHtml = strHtml.replace(objRegExp,"");

	return strHtml;
}

function imgResize(target_img, g_width, g_height)
{
    var newX, newY;
    var newHeight, newWidth;
    var newImg;

    var maxWidth = g_width;
    var maxHeight = g_height;

    newImg = new Image();
    newImg.src = target_img.src;
    imgw = newImg.width;
    imgh = newImg.height;

    /*
	if (imgw*1.2 >= imgh) {
    	return false;
    }
	*/

    if (imgw > maxWidth || imgh > maxHeight)
    {
        if(imgw > imgh)
        {
            if(imgw > maxWidth)
                newWidth = maxWidth;
            else
                newWidth = imgw;
            newHeight = Math.round((imgh*newWidth)/imgw);
        }
        else
        {
            if(imgh > maxHeight)
                newHeight = maxHeight;
            else
                newHeight = imgh;
            newWidth = Math.round((imgw*newHeight)/imgh);
        }
    }
    else
    {
        newWidth = imgw;
        newHeight = imgh;
    }
    newX = maxWidth/2 - newWidth/2;
    newY = maxHeight/2 - newHeight/2;

	target_img.onload = null;
	target_img.src = newImg.src;
    target_img.width = newWidth;
    target_img.height = newHeight;

}

//³â, ¿ù, ÀÏ ÀÔ·Â½Ã ³ªÀÌ ¸®ÅÏ
function getAge(yy, mm, dd) {

	days = new Date();
	gdate = days.getDate();
	gmonth = days.getMonth();
	gyear = days.getYear();
	age = gyear - yy;
	if((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
		age = age;
	}
	else {
		if(mm <= (gmonth)) {
			age = age;
		}
		else {
			age = age - 1; 
		}
	}
	if(age == 0)
		age = age;
		
	return age;
}

/* »õÃ¢À» È­¸é °¡¿îµ¥ ¶ì¿ò */
function openCenterWin(w_url,w_title,w_width,w_height,w_resizable,w_scrollbars)
{
	var option = "alwaysRaised,toolbar=0,status=0,menubar=0";
	
	var w_left = (screen.width)?(screen.width-w_width)/2:100;
	var w_top = (screen.height)?(screen.height-w_height)/2:100;
	
	//width ¿Í height °¡ ÀÖÀ»¶§¸¸ È­¸éÀÇ °¡¿îµ¥¿¡ Ç¥½ÃÇÑ´Ù
	if (w_width) option = option + ",width=" + w_width + ",left=" + w_left;
	if (w_height) option = option + ",height=" + w_height + ",top=" + w_top;
	//Ã¢Å©±â Á¶Àý°¡´É°ú ½ºÅ©·Ñ¹Ù Ç¥½Ã´Â ±âº»ÀûÀ¸·Î º¸ÀÌÁö ¾ÊÀ¸¸ç, ÁöÁ¤ÇÒ¶§¸¸ º¸ÀÎ´Ù
	if (w_resizable == true) option = option + ",resizable=yes";
	if (w_scrollbars == true) option = option + ",scrollbars=yes";

	var new_instance = window.open(w_url,w_title,option,"");
	new_instance.focus();
}

function isObject(form_element_name)
{
	val = typeof(form_element_name);

	if( val == "undefined")
		return false;
	else
		return true;
}

//¾ËÆÄºª Ã¼Å© ÇÔ¼ö
function isAlpha(form_element_name, msg)
{
	var alpha ='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var num='0123456789';
	var alphanum=alpha + num;
	var t = form_element_name.value;

	for (i=0; i<t.length; i++){
			if (alphanum.indexOf(t.substring(i,i+1))<0) {
				alert(msg);
				form_element_name.focus();
				return false;
			}
	}

	return true;
}

function moveNextBox(str_size, form_element_name, next_form_element_name)
{
	if(form_element_name.value.length>=str_size)
		next_form_element_name.focus();
}

function isEmail(form_element_name){
	var email = form_element_name.value;
	var strPattern = "^[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*@[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)+$";
	
	if (email.match(strPattern)){
		return true;
	}
	else{
		alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò¸¦ ÀûÈ®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		form_element_name.focus();
		return false;
	}
} 

//basic function : 
function isFrmEmpty(form_element_name, msg)
{
	if(form_element_name.value == ""){
		alert(msg);
		form_element_name.focus();
		return true;
	}
	else
		return false;
}

//basic function : 
function isNumber(form_element_name, msg)
{
	if(isFrmEmpty(form_element_name, msg))
		return false;
	else {
		if(!isNaN(form_element_name.value))
			return true;
		else {
			alert(msg);
			form_element_name.focus();
			return false;
		}
	}
}




//basic function :
function isSame(form_element_name1, form_element_name2, msg)
{
	if(form_element_name1.value == form_element_name2.value)
		return true;
	else {
		alert(msg);
		form_element_name1.focus();
		return false;
	}
}

function isCheck(form_element, msg){
	var is_checked = false;
	for(i=0; i<form_element.length; i++){
		if(form_element[i].checked){
			is_checked = true;
			break;
		}
	}

	if(is_checked){
		return true;
	}
	else {
		alert(msg);
		return false;
	}
}

//extend function :
function isNumber3(form_element_num1, form_element_num2, form_element_num3, msg)
{
	if(!isNumber(form_element_num1, msg))	return false;
	if(!isNumber(form_element_num2, msg))	return false;
	if(!isNumber(form_element_num3, msg))	return false;

	return true;
}

function isMultiCheck(form_name, form_element, msg){
	var box = eval("document."+form_name+".elements['"+form_element+"']");
	if(box.length>1){
		is_checked = false;
		for(i=0; i<box.length; i++){
			if(box[i].checked==true){
				is_checked = true;
				break;
			}
		}

		if(!is_checked){
			alert(msg);
			return false;
		}
	}

	return true;
}

function isArray(form_name, form_element){
	var form_element2 = eval("document."+form_name+".elements['"+form_element+"']");
	if(form_element2.length>1)
		return true;
	else
		return false;
}

//extend function :
function isJumin(form_element_jumin1, form_element_jumin2)
{
	if(!isNumber(form_element_jumin1, "ÁÖ¹Îµî·Ï ¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä"))	return false;
	if(!isNumber(form_element_jumin2, "ÁÖ¹Îµî·Ï ¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä"))	return false;
	
	if(!checkJumin(form_element_jumin1, form_element_jumin2)){
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.");
		form_element_jumin1.focus();
		return false;
	}

	return true;
}

function getChkLen(form_element)
{
	var cnt; 
	var vartype = typeof(form_element.length);

	if(vartype=="undefined")
		 cnt = 1;
	else
		cnt = form_element.length;
	
	return cnt;
}

function getChkCnt(form_name, element_name)
{
	var chklen = 0;
	var form_element;

	form_element = eval("document."+form_name+"."+element_name);
	var cnt = getChkLen(form_element);

	if(cnt==1){
		if(form_element.checked==true)
			chklen = 1;
		else
			chklen = 0;
	}
	else{
		for(i=0; i<cnt; i++){
			form_element = eval("document."+form_name+"."+element_name+"["+i+"]");
			if(form_element.checked==true)
				chklen += 1;
		}
	}

	return chklen;
}

function selectAll(form_name, element_name)
{
	var form_element = eval("document."+form_name+"."+element_name);
	var len = getChkLen(form_element);

	if(len<=1){
		var chkbox = eval("document."+form_name+"."+element_name);
		if(chkbox.checked==false)
			chkbox.checked = true;
		else
			chkbox.checked = false;
	}
	else {
		var chkbox0 = eval("document."+form_name+"."+element_name+"[0].checked");

		for(i=0; i<len; i++){
			var chkbox = eval("document."+form_name+"."+element_name+"["+i+"]");
			
			if(chkbox0==true)
				chkbox.checked = true;
			else
				chkbox.checked = false;
		}
	}
}

function selectAll2(root_check, form_name, element_name)
{
	var form_element = eval("document."+form_name+"."+element_name);

	var len = getChkLen(form_element);

	if(len<=1){
		var chkbox = eval("document."+form_name+"."+element_name);
		if(root_check.checked==false)
			chkbox.checked = false;
		else
			chkbox.checked = true;
	}
	else {
		for(i=0; i<len; i++){
			var chkbox = eval("document."+form_name+"."+element_name+"["+i+"]");
			
			if(root_check.checked==true)
				chkbox.checked = true;
			else
				chkbox.checked = false;
		}
	}
}

//¸ðµç checkbox¼±ÅÃ
function allcheck(sel){ 
	var f = document.FRM; 
    var getobj = document.getElementsByTagName("input"); 
    for(var i=0; i<getobj.length; i++){ 
        if(getobj[i].type.toLowerCase() == "checkbox"){ 
            getobj[i].checked = sel; 
        }
    } 
} 


function gosearch()
{
	document.f.submit();
}
function goIni()
{
	document.f.search.value="";
	document.f.what.value="";
	document.f.submit();
}

function search()

{
	var form = document.FRM;
/*
	if(isObject(form.scolumn)){
		if(isFrmEmpty(form.scolumn, "°Ë»öÇÒ ºÐ·ù¸¦ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À"))	return;
	}
*/
	form.submit();
}

function searchM(form)
{
	form.action = "/module/common/requestMult.asp";
	form.submit();
}

function searchMR(form)
{
	form.action = "/module/common/requestMultTo.asp";
	form.submit();
}

function format_number(num) { 
	if (num < 0) { num *= -1; var minus = true} 
	else var minus = false 

	var dotPos = (num+"").split(".") 
	var dotU = dotPos[0] 
	var dotD = dotPos[1] 
	var commaFlag = dotU.length%3 

	if(commaFlag) { 
	var out = dotU.substring(0, commaFlag) 
	if (dotU.length > 3) out += "," 
	} 
	else var out = "" 

	for (var i=commaFlag; i < dotU.length; i+=3) { 
	out += dotU.substring(i, i+3) 
	if( i < dotU.length-3) out += "," 
	} 

	if(minus) out = "-" + out 
	if(dotD) return out + "." + dotD 
	else return out 
} 

/* SMS¿ë ÇÑ±Û ¹ÙÀÌÆ® Ã³¸® ÇÔ¼ö */
function getByteLength(s) 
{ 
  var len = 0; 
  if ( s == null ) return 0; 
  for(var i=0;i<s.length;i++){ 
      var c = escape(s.charAt(i)); 
      if ( c.length == 1 ) len ++; 
      else if ( c.indexOf("%u") != -1 ) len += 2; 
      else if ( c.indexOf("%") != -1 ) len += c.length/3; 
  } 
  return len; 
}

function setSmsValue(form_element, set_form_element, max_len)
{
	var cnt = 0;
	cnt = getByteLength(form_element.value);
	if(max_len!=""){
		if((event.keyCode<48)||(event.keyCode>57)){
		}else{
			max_len -= 2;	//ÇÑ±ÛÀÏ °æ¿ì 2¹ÙÀÌÆ® Á¦°Å
		}
//		document.all.err.innerHTML = max_len+" : "+cnt;
		if(parseInt(max_len) < parseInt(cnt)){
			alert("ÀÔ·ÂÇÑ ±ÛÀÚ°¡ "+max_len+"À» ÃÊ°úÇÕ´Ï´Ù. "+max_len+"¸¦ ÃÊ°úÇÑ ±ÛÀÚ¸¦ ÀÚµ¿À» Àß¶ó³À´Ï´Ù");
			form_element.value = form_element.value.substring(0, max_len); 
			cnt = getByteLength(form_element.value);
		}
	}
	set_form_element.innerHTML = cnt;
//	set_form_element.value = cnt;
}

function zoomZ(img){
	window.open("/module/common/zoom.asp?img="+img,"img","left=100,top=100");
}

function openMovie(file_name){
	window.open("/module/common/viewMovie.asp?fn="+file_name,"movie","left=0,top=0,width=350,height=350,scrollbars=auto");
}

function downFile(file_dir, file_name, bid, idx, num){
	location.href="/module/common/download.asp?file_dir="+file_dir+"&file_name="+file_name+"&bid="+bid+"&idx="+idx+"&num="+num;
}

function AutoAddr(key){
	url	= "/module/common/PostChoice.asp?key="+key;
	window.open(url,"AutoAddr","toolbar=no,menubar=no,scrollbars=0,resizable=no,width=320,height=350");
}

function checkid()
{
	var form = document.FRM;

	if (form.userid.value.length < 4) {
		alert("ID´Â 4±ÛÀÚ ÀÌ»óÀÔ´Ï´Ù!!") ;
		form.userid.focus() ;
		return;
	}
	if(!isAlpha(form.userid, "¾ÆÀÌµð´Â ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä"))	return;

	window.open('/module/common/UserIdCheck.asp?userid=' + form.userid.value,'CheckID','top=200,left=500,width=300,height=200');
}

//ÀÏÁ¤ ¼±ÅÃ¿ë ÆË¾÷
function popSchedule(syear, smonth, sday)
{
	openCenterWin("/module/common/pop_calendar.asp?syear="+syear+"&smonth="+smonth+"&sday="+sday,"view",310,240,false,true);
}

//´Þ·Â ÆË¾÷À» ¶ç¿ì°í TextBox¸¦ ÁöÁ¤ÇÏ¸é ÀÚµ¿À¸·Î ¼±ÅÃÇÑ ³¯ÀÚ Ã¤¿ò.
//flag : T (ÇöÁ¦±îÁö º¸ÀÌ°Ô) 
function Facade_cal_show(objTextBox, flag)
{   
    var yyyymmdd = "";
    if (objTextBox != null)
    {
        objTextBox = (objTextBox.nodeType != 1 ? objTextBox.previousSibling : objTextBox); 
        yyyymmdd = objTextBox.value;
    }
    
    var ret = cal_show(yyyymmdd, flag);
    
      
    if(objTextBox != null && ret != null)
        objTextBox.value = ret;
 
     return ret;    
}

/* -----------------------------------------------ÆË¾÷Çü ´Þ·Â ÇÕ¼ö ----------------------------------------------------------*/	
//´Þ·ÂÀ»  ÆË¾÷ÇÔ..
function cal_show(yyyymmdd, flag)
{
    ///alert(yyyymmdd);
    var regExp = new RegExp("/","g");                
    var yyyymmdd = yyyymmdd.replace(/-/g,"").replace(regExp,"");
    
    if(yyyymmdd.length != 8 || yyyymmdd == "99991231")
    {
        var date = new Date();
        var new_month = 0;
        if(date.getMonth() + 1 < 10)
            new_month = "0" + (date.getMonth() + 1);
        else 
            new_month = date.getMonth() + 1
        
         date = new Date();
         yyyy  = date.getFullYear() + "";
         mm =  new_month ; // 1¿ù=0,12¿ù=11ÀÌ¹Ç·Î 1 ´õÇÔ
         dd   = date.getDate() + "";    
         
         yyyymmdd = yyyy + mm + dd ;        
    }

    var Args = new Object();
    Args.Year   = eval(yyyymmdd.substr(0, 4));
    Args.Month  = eval(yyyymmdd.substr(4, 2));
    Args.Day    = eval(yyyymmdd.substr(6, 2));
    Args.Flag   = flag;
    
    
    //alert(window.screenLeft);
    
    var left = window.screenLeft + event.clientX + 5
    var top = window.screenTop + event.clientY + 5
    
    var ret = window.showModalDialog("/module/schedule/Calendar.html", Args, "dialogLeft:"+left+"px;dialogTop:"+top+"px;dialogWidth:165px;dialogHeight:170px;scroll:no;status:on;help:no");
    if(ret != null)
        return ret;
}

//Stirng °´Ã¼¿¡ padLeft ¸Å¼Òµå Ãß°¡. (ex0 "aaa".padLeft(5," ") ===> "aaa  "
String.prototype.padLeft=function( strLen, padChar)
{
	
	thisText = this.trim()
	
	var padStr = "";
	
	if(thisText.length < strLen)
	{
		for(var i=0; i< strLen - thisText.length ; i++)
			padStr += padChar;			
	}
	return padStr + thisText;
	
}


var popCount = 0;
function PopOpen(url, width, height)
{    
    
    popCount++;    

	winpos = "left=" + ((window.screen.width-width)/2 + (popCount*50)) + ",top=" + ((window.screen.height-height)/2 + (popCount*10));
    winstyle="width="+width+",height="+height+",status=yes,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes,copyhistory=no," + winpos;
    window.open(url,"pop"+popCount,winstyle);
    

}

function PopOpenExcel(url, width, height)
{    
    winpos = "left=" + ((window.screen.width-width)/2 + (popCount*50)) + ",top=" + ((window.screen.height-height)/2 + (popCount*10));
    winstyle="width="+width+",height="+height+",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,copyhistory=no," + winpos;
    window.open(url,"pop",winstyle);
    
    popCount++;    
}

function PopOpenModal(url, width, height)
{    
    winpos = "left=" + ((window.screen.width-width)/2 + (popCount*50)) + ",top=" + ((window.screen.height-height)/2 + (popCount*10));
    winstyle="width="+width+",height="+height+",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos;
    parent.showModalDialog(url,"pop"+popCount,winstyle);
    
    popCount++;    
}

function PopOpenMo(url, width, height)
{    
    winpos = "left=" + ((window.screen.width-width)/2 + (popCount*50)) + ",top=" + ((window.screen.height-height)/2 + (popCount*10));
    winstyle="width="+width+",height="+height+",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,copyhistory=no," + winpos;
    window.showModalDialog(url,"pop",winstyle);
    
    popCount++;    
}

//ÄíÅ°°ü·Ã
function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) { //while open
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break; 
   } //while close
   return null;
}


function setCookie(name, value, expiredays)
{
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


var popCountMo = 0;
function PopOpenMovie(url, width, height)
{    
    winpos = "left=" + (window.screen.width)/2 + ",top=" + (window.screen.height)/2 ;
    winstyle="width="+width+",height="+height+",status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,copyhistory=no," + winpos;
    window.open(url,"popM"+popCountMo,winstyle);

	popCountMo++;  
}

function PopOpenPpt(url, width, height, Pname)
{    
    winpos = "left=" + (window.screen.width)/4 + ",top=" + (window.screen.height)/7 ;
    winstyle="width="+width+",height="+height+",status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=auto,copyhistory=no," + winpos;
    window.open(url,Pname,winstyle);
}

//¼ýÀÚ¿Í - ÀÔ·Â°¡´ÉÇÑ ÅØ½ºÆ® ¹Ú½º ½ºÅ©¸³Æ® function
//À§ÀÇ ¹®ÀÚ¿Ü¿¡ ´Ù¸¥ ¹®ÀÚ ÀÔ·Â½Ã Å×½ºÆ®¹Ú½º Clear
function OnlyNumericDashCheck(thisone)
{ 
	var tempnum = thisone.value;
	
	for ( i = 0; i <= tempnum.length; i++ )
	{ 
		if( (tempnum.charCodeAt(i) < 48 || tempnum.charCodeAt(i) > 57) && tempnum.charCodeAt(i) != 45 )
		{
			thisone.value = tempnum.substring( 0, i );
			break ;
		}
	}
}

function onlyNumber()  //¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
{
   if((event.keyCode<48)||(event.keyCode>57))
      event.returnValue=false;
} 

//¼ýÀÚÀÔ·Â¹Ú½ºÀÇ ÄÄ¸¶¸¦ Âï¾îÁÖ´Â ½ºÅ©¸³Æ® function
	function CommaFormat(thisone)
	{ 
		// °ªÀÌ - ÀÏ¶§´Â ¸¶ÀÌ³Ê½º Ã¼Å© ÇÔ¼ö½ÇÇà
		if(thisone.value.substring(0,1) == "-")
		{
			MinusCommaFormat(thisone);
			return;
		}
		var tempnum = "";
	    
		if(thisone.value.split(",").length ==1)
		{
			tempnum=thisone.value;
		}
		else
		{
			for(i = 0; i < thisone.value.split(",").length ; i++)
			{
				tempnum = tempnum + thisone.value.split(",")[i]
					}
		}
	    
		var str = "";
		var count = 0;
	    
		for (i = tempnum.length; i > 0; i--)
		{ 
			if(tempnum.charCodeAt(i) == 46)
			{
				var tempnum2 = "";
	            
				if(str.split(".").length == 1)
				{
					str = str;
				}
				else
				{
					for(k = 0; k < str.split(",").length; k++)
					{
						tempnum2 = tempnum2 +  str.split(",")[k]
					}
	                
					str = tempnum2;
					count = 0;
				}
			}
			if(count == 3)
			{
				str = "," + str;
				count = 0;
					}
			str = tempnum.substring(i,i-1) +str;
			count = count + 1 ;
		}
		thisone.value = str;
	}


	function doBlink() {
		var blink = document.all.tags("BLINK")
		for (var i=0; i < blink.length; i++)
		   blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
		}

function startBlink() {
		if (document.all)
		   setInterval("doBlink()",400)
		}


function SpaceChk(str)
		{
			var nulcount = 0;
			
			if(SpaceChange(str)=="")
			{
				return false;
			}
							
			for(i=0; i < str.length;i++)
			{
					a=str.substr(i,1);
					if(a==" ")
					{
						nulcount = nulcount + 1;
															
					}
			}
			
			if(nulcount>0)
			{
				return false;
			}
			
				return true;
				
		}
		
		
		
		
	/*
	¼ýÀÚÇü½Ä Ã¼Å©
	*/	
	function isNumber1(obj)
	 {
			if (isNaN(obj)) 
			{
				return false;
			}
				return true;
	}

	function SpaceChange(str)
		{
			var tempstr=str.replace(/(\s+$)/g,"");
			return tempstr;
		}		
