﻿function txtEscape(strSource) {
	var arrTemp = new Array();
	arrTemp = strSource.split("[br]");
	strSource = arrTemp.join("<br/>");

	arrTemp = strSource.split("（");
	strSource = arrTemp.join("(");
	arrTemp = strSource.split("）");
	strSource = arrTemp.join(")");

	arrTemp = strSource.split("&apos;");
	strSource = arrTemp.join("\'");
	arrTemp = strSource.split("&quot;");
	strSource = arrTemp.join("\"");
	arrTemp = strSource.split("&amp;");
	strSource = arrTemp.join("&");

	arrTemp = strSource.split("\0x09");
	strSource = arrTemp.join("");
	arrTemp = strSource.split("\0x0d");
	strSource = arrTemp.join("");
	arrTemp = strSource.split("\0x0a");
	strSource = arrTemp.join("");

	arrTemp = strSource.split("`");
	strSource = arrTemp.join("\'");
	arrTemp = strSource.split("’");
	strSource = arrTemp.join("\'");
	return strSource;
}

if (!Array.prototype.indexOf) {
	Array.prototype.indexOf = function(obj, start) {
		for (var i = (start || 0), j = this.length; i < j; i++) {
			if (this[i] === obj) { return i; }
		}
		return -1;
	}
}
// 배열의 원소를 무작위로 정렬
//function Shuffle(o) { for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o;};
function Shuffle(o) {
  var i = o.length, j, tempi, tempj;
  if ( i == 0 ) return false;
  while ( --i ) {
     j = Math.floor( Math.random() * ( i + 1 ) );
     tempi = o[i];
     tempj = o[j];
     o[i] = tempj;
     o[j] = tempi;
   }
}
// Date.now IE7/8 patch
Date.now = Date.now || function() { return +new Date; }

// console.log
window.console = window.console || {
  log: function () {}
};