function Singleton(param){
var count = 0, old = window[param];
window[param] = function(){
if(++count <= 1) return old;
else alert('NO WAY!');
}
}
You would call it as:
Singleton('Circle');
Demo: http://jsfiddle.net/maniator/7ZFmE/
Remember this only works if Circle
or any other function class is in the global window
namespace. Anything in any other namespace would need some more manipulation to make it work fully.