return out;
},
+ /**
+ * Returns the object's class name.
+ *
+ * @param {object} obj target object
+ * @return {string} object class name
+ */
+ getType: function(obj) {
+ return Object.prototype.toString.call(obj).replace(/^\[object (.+)\]$/, '$1');
+ },
+
+ /**
+ * Returns a RFC4122 version 4 compilant UUID.
+ *
+ * @see http://stackoverflow.com/a/2117523
+ * @return {string}
+ */
+ getUuid: function() {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+ var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
+ return v.toString(16);
+ });
+ },
+
+ /**
+ * Recursively serializes an object into an encoded URI parameter string.
+ *
+ * @param {object} obj target object
+ * @return encoded parameter string
+ */
+ serialize: function(obj) {
+ var parameters = [];
+
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ var value = obj[key];
+
+ if (Array.isArray(value)) {
+ for (var i = 0, length = value.length; i < length; i++) {
+ parameters.push(key + '[]=' + encodeURIComponent(value[i]));
+ }
+
+ continue;
+ }
+ else if (this.getType(value) === 'Object') {
+ parameters.push(this.serialize(value));
+
+ continue;
+ }
+
+ parameters.push(key + '=' + encodeURIComponent(value));
+ }
+ }
+
+ return parameters.join('&');
+ },
+
triggerEvent: function(el, eventName) {
var ev;
if (document.createEvent) {