var name = findInstanceOf(cPoll);
function findInstanceOf(obj) {
for (var v in window) {
try {
if (window[v] instanceof obj)
return v;
} catch(e) { }
};
return false;
}
From http://www.liam-galvin.co.uk/2010/11/24/javascript-find-instance-name-of-an-object/#read