function Num_Comma(obj) {
	str = obj.value;
	s = new String(str);	
	
	s=s.replace(/\D/g,"");
	
	if (s.substr(0,1)==0 ) {
		s = s.substr(1);
	}		
	
	l=s.length-3;
	while(l>0) {
		s=s.substr(0,l)+","+s.substr(l);
		l-=3;
	}
//	return s;	
	obj.value = s;		
}

function cc(obj, color)
{
	obj.style.backgroundColor = color; 
}


function cc_date(obj, color, form_nm,method)
{
	eval(form_nm+".value='';");
	obj.style.backgroundColor = color; 
}

function mouseOnTR(obj, bool){
	if (bool){
		if(obj.style.backgroundColor!="#d1cafe"){
			obj.style.cursor = 'hand';
			obj.style.backgroundColor = '#E8F7FF';
		}
	}
	else{
		if(obj.style.backgroundColor!="#d1cafe"){
			obj.style.cursor = 'default';
			obj.style.backgroundColor = '';
		}
	}
}

function onlyNumber(e,i)  //¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
{
	if(e.keyCode==13)
		e.keyCode=9
	else{
	if(((e.keyCode==16)||(e.keyCode<8)||((e.keyCode>9)&&(e.keyCode<37))||((e.keyCode>40)&&(e.keyCode<46))||((e.keyCode>46)&&(e.keyCode<48))||((e.keyCode>57)&&(e.keyCode<96))||(e.keyCode>105))&&(e.keyCode!=13)&&(e.keyCode!=189)&&(e.keyCode!=109))
		e.returnValue=false;
	}
}

function onlyNumber_ee(e,i)  //¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
{
	if(e.keyCode==16){
		e.returnValue=false;
	}

	if(e.keyCode==13)
		e.keyCode=9
	else{
	if(((e.keyCode==16)||(e.keyCode<8)||((e.keyCode>9)&&(e.keyCode<37))||(e.keyCode>105))&&(e.keyCode!=13)&&(e.keyCode!=189)&&(e.keyCode!=109))
		e.returnValue=false;
	}
}

function onlyNumber_tab(e,i)  //¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
{
	if(e.keyCode==13)
		e.keyCode=9
}

function checknum(num) 
{
	var s = new String(num.value);	
	s=s.replace(/\D/g,"");
	var val="-0123456789";
	var string=num.value;
	var len=string.length;
	for(i=0;i<len;i++) 
	{
		if(val.indexOf(string.substring(i,i+1))<0) 
		{
			num.value = s;		
			return;
		}
	}
}

function checkPointer(Str,form_nm)
{
	with (form_nm)
	{
		if (Str.length==4 || Str.length==7) Str += "/";
			form_nm.value=Str;
	}
}

function openWindow(url, name, width, height)   {   
    var top     =       screen.height / 2 - height / 2 - 50;
    var left    =       screen.width / 2 - width / 2 ;
    var win = open(url, name, 'width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no');

}

function openWindowNo(url, name, width,height)   {
        
    var top     =       screen.height / 2 - height / 2 - 50;
    var left    =       screen.width / 2 - width / 2 ;
    var win = open(url, name, 'width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=no,resizable=yes,status=no,toolbar=no,menubar=no');
    win.focus();
   // return win;
}

function openWindow_pop(url, name, width, height,top,left, scroll, resize, status, toolbar, mbar)   {
	
	
    var top     =       screen.height / 2 - height / 2 - 50;
    var left    =       screen.width / 2 - width / 2 ;
    var win = open(url, name, 'width='+width+',height='+height+',top='+top+',left='+left+',scrollbars='+scroll+',resizable='+resize+',status='+status+',toolbar='+toolbar+',menubar='+mbar+'');
    //win.focus();
   // return win;
}

function openWindow01(url, name, width, height)   {		
    var top     =       screen.height / 2 - height / 2 - 50;
    var left    =       screen.width / 2 - width / 2 ;
	var a		=		width - 12;
	var b		=		height - 31;
    var win = open(url, name, 'width='+a+',height='+b+',top='+top+',left='+left+',resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=no');
    //win.focus();
    //return win;
}

function isEmail(s){
  return s.search(/^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g)>=0;
}

//Ã¼Å© µÈ°Ô ÀÖ´ÂÁö È®ÀÎ ÇÏ´Â ÇÔ¼ö
function chk_cnt(obj) {
	if (obj.length != null) {
		for (i=0; i < obj.length;i++) {		
			if (obj[i].checked == true) {
				return true;
			}			
		}
	}
	else {		
		if (obj.checked == true) {
			return true;
		}		
	}	
}

//°ø¹é Ã¼Å© 
function chk_blank(obj) {	
	var strSubj = obj.value;
	var resultSubj = strSubj.split(" ");
	if (strSubj.length + 1 == resultSubj.length) {
		return true;
	}
	else {
		return false;
	}
}
