//By Hara Partners team members
//This bug fix is aimed at prototype 1.6.x.x version where the JSON.stringyfy() adds problematic quotation marks around array objects
var HaraPartnersUtility = {};
HaraPartnersUtility.stringify = function (obj) {
    var t = typeof (obj);
    if (t != "object" || obj === null) {
        // simple data type
        if (t == "string") obj = '"'+obj+'"';
        return String(obj);
    }
    else {
        // recurse array or object
        var n, v, jsonTemp = [], arr = (obj && obj.constructor == Array);
        for (n in obj) {
			if(obj.hasOwnProperty(n)){
				v = obj[n]; t = typeof(v);
				if (t == "string") v = '"'+v+'"';
				else if (t == "object" && v !== null) v = HaraPartnersUtility.stringify(v);
				jsonTemp.push((arr ? "" : '"' + n + '":') + String(v));
			}
        }
        return (arr ? "[" : "{") + String(jsonTemp) + (arr ? "]" : "}");
    }
};

