var ENC = new function(){ this.baseurl = 'http://www.gokuscorner.com/'; this.loggedIn = false, this.socialNetwork = true; this.loggedInViaFacebook = false; this.init = function(key, brokerUrl){ this.apiKey = key; this.brokerUrl = brokerUrl; this.start(); }; var that = this; }; // jQuery makes life easier. So I used it, but it's not a strict dependency if you want to rewrite code. No plugins used. document.write("