String.prototype.getHostname = function () {
            var re = new RegExp('^(?:f|ht)tp(?:s)?://([^/]+)');
            return this.match(re) [1].toString();
        };