function setScouterTag() {
	if (!(document.location.href.match(/ssl/))){
		document.write("<iframe src='http://scouter.hangame.co.jp/scouter?"+location.hostname+location.pathname+location.search.substr(1,location.search.length)+"' width=0 height=0 frameborder=0></iframe>");
		document.write("<iframe src='http://scouter.hangame.co.jp/uqc?"+location.hostname+location.pathname+location.search.substr(1,location.search.length)+"' width=0 height=0 frameborder=0></iframe>");
	}
}

function checkContentWordSize(obj, max, name) {
	if(obj.value.length > max) {
    obj.blur();
    obj.value = obj.value.substring(0, max);
    obj.focus();
	}

  var o = document.getElementById(name);
  o.innerText = obj.value.length;
}

function goLogInOut(mode) {
  var frm = document.frmFmtLogin;

  var toUrl = "";
  if(mode == "login") {
  	toUrl = "/loginout.nhn?m=login";
  }	else if(mode == "logout") {
  	toUrl = "/loginout.nhn?m=logout";
  }

  frm.action = toUrl;
  frm.method = "post";
  frm.submit();
}

String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function isValidEmailAddress(email) {
	// loosely checking
	var re = /.+@.+/g;
	return re.test(email);
}

function isNumeric(s) {
	if ( s.length == 0 ) return false;
	var re = /[0-9]+/g;
	return re.test(s);
}

// for check whitespace.
function isEmpty(s) {
	return ((s == null) || (s.length == 0))
}

function isWhitespace(s) {
	var i;

	if(isEmpty(s)) return true;

	for(i = 0; i < s.length; i++) {
		var c = s.charCodeAt(i);
		if(c != 12288 && c != 32) return false;
	}

	return true;
}

function getFormatMoney(value) {
   var num  = String(value);

   re   = /^\$|,/g;
   num   = num.replace(re, "");
   fl   = "";

   if(num < 0)
   {
    num  = num*(-1);
    fl  = "-";
   }
   else
   {
    num  = num * 1;
   }

   num = new String(num);

   var temp = "";
   var co  = 3;
   var num_len = num.length;

   while (num_len > 0)
   {
    num_len = num_len - co;

    if(num_len < 0)
    {
     co = num_len + co;
     num_len = 0;
    }

    temp = "," + num.substr(num_len,co) + temp;
   }

   return fl+temp.substr(1);
}

function removeSpecialCharactersQuot(str) {
	var tempStr = "";

	tempStr = str;

	tempStr = tempStr.replace(/"/g, "");
	tempStr = tempStr.replace(/'/g, "");

	return tempStr;
}


