// window popup
function MM_openBrWindow(theURL,winName,features) { //v2.0
  var obj = window.open(theURL,winName,features);
  
  return obj;
}

//ÄíÅ° SET
function setCookie( name, value , expiredays )
{
  var todayDate = new Date();
  todayDate.setDate( todayDate.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() +  ";"
 }

// ÄíÅ° GET
function 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 chkNum(checkStr) {
    if(checkStr == "") return false;
	for(i = 0;i < checkStr.length;i++) {
		ch = checkStr.charAt(i);
		if(!(ch >= "0" && ch <= "9"))
			return false;
	}
	return true;
}

function chkEng(checkStr) {
    if(checkStr == "") return false;
	for(i = 0;i < checkStr.length;i++) {
		ch = checkStr.charAt(i);
		if(!((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")))
			return false;
	}
	return true;
}

function chkNumEng(checkStr) {
    if(checkStr == "") return false;
	for(i = 0;i < checkStr.length;i++) {
		ch = checkStr.charAt(i);
		if(!((ch >= "0" && ch <= "9") || (ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")))
			return false;
	}
	return true;
}

function emailCheck(emailad) {
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}| [^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;
	var parse_email = emailad.split("@");
	if ( emailad ) {
		if(((emailad.search(exclude) != -1)||(emailad.search(check)) == -1)||(emailad.search(checkend) == -1)){
   	    	   return false;
		} else {
			return true;
		}
	}
}

// °¡°Ý Æ÷¸Ë Àû¿ë
function number_format(num){

	var formatNum = '';
	var comma;
	var tmpNum = 0;
	for(var i=num.length-1; i>=0; i--){

		if((tmpNum%3) == 0 && tmpNum != 0){
			comma = ',';
		}else{
			comma = '';
		}
		
		formatNum = num.charAt(i)+comma+formatNum;
		
		tmpNum++;
	}
	
	return formatNum;
}