// create a variable to toggle debugging
var debugMode = true;
function debug() {
if (debugMode===true) {
var x = "debug", a = arguments.length ? arguments : ["debug"];
var c = ["error","warn","info","log","debug"];
var t = c.some ? (c.some(function(v) { return x = (a[0].indexOf(v)>-1) ? v : false; }))||x : x;
return console[(x||t)](arguments);
}
}