Object.getConstructorName=function(obj){ var constr=new String(obj.constructor); return constr.slice(constr.indexOf("function ") +"function ".length,constr.indexOf("("));};