var conf = {
	_removeHTTP: function (url) {
		if(url.substr(0, 4) == 'http')
			return url.slice(7);
		return url; 
	},
	
	getDomain: function (url) {
		return conf._getUrlParts(url).pop();
	},

	getAppDomain: function (url) {
		return conf._getUrlParts(url)[1];
	},
	
	_getUrlParts: function (url) {
		var httplessUrl = conf._removeHTTP(url);
		var split_by_slash = httplessUrl.split('/');
		return split_by_slash[0].split('.');
	},
	
	getPath: function (url) {
		var split_by_slash = url.split('/');
		split_by_slash.splice(0, 3);
		return split_by_slash.join('/');
	}
};

conf.app = conf.getAppDomain(location.hostname);	// es. theclub
conf.env = conf.getDomain(location.hostname);		// es. pvt
conf.domain = conf.app + '.' + conf.env;	// es. theclub.pvt
conf.staticUrl = 'static.' + conf.domain;	// es. static.theclub.pvt
conf.dynamicUrl = 'www.' + conf.domain;	// es. www.theclub.pvt
conf.baseUrl = location.hostname;	// es. nickname.theclub.pvt || www.theclub.pvt
conf.href = location.href;	// url completa es. http://www.theclub.pvt/home
conf.path = conf.getPath(conf.href);	// path dell'url es. romance
conf.url = location.href;	// url completa es. http://www.theclub.it/romance