/**
 * Make desired prototype changes
 */

Object.prototype.in_array = function(datum, strict) {
    if (strict) {
     	function equals(a,b) { return a === b };
    } else {
    	function equals(a,b) { return a == b };
    }

    for (var i in this) {
        if (equals(this[i], datum)) { return true; };
    }
    return false;
}

String.prototype.trim = function () {
    return this.replace(/^\s+|\s+$/g, "");
}; 
String.prototype.entityify = function () {
    return this.replace(/&/g, "&amp;").replace(/</g,"&lt;").replace(/>/g, "&gt;");
};

String.prototype.unentityify = function () {
	return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");
};


// TODO:  See if and where this is used
function addAdSlashes(str) {
	str=str.replace(/\'/g,'\\\'');
	return str;
}



