var domain = '';
var moderator = 'Moderator/';
var show = 'show/';
var panel = 'member/';
var moc = 'moc/';

if(!jQuery().PathFinder){
	jQuery.PathFinder = function(){
		var it = {}; 
		var params = new function(){
			this.URL = document.URL; 
			this.domain = document.domain; 
			return this; 
		}; 
		it.getRootPath = function(tag, attr, path){
			var root = jQuery(tag+"[@"+attr+"$="+path+']').attr(attr);
			if(!root) return false;
			
			root = root.replace(path, ''); 
			root = root.replace(/^http(s)?:\/\/[^\/]+/, ''); 
			//because the src attr could have been a partial or complete url 
			if(root){
				return root; 
			} else { 
				return false;
			}
		}; 
		it.webRoot = it.getRootPath('script', 'src', '/js/settings.js'); 
		it.styleUrl = it.getRootPath('link', 'href', '/index.css'); 
		if(!it.styleUrl) { //Try to find the custom
			it.styleUrl = it.getRootPath('link', 'href', '/custom.css'); 
		}
		it.httpMethod = params.URL.replace(/^(http|https)(:\/\/).*$/, "$1$2"); 
		it.baseURL = it.httpMethod + params.domain;
		if(it.webRoot)
			it.baseURL += it.webRoot;
		it.baseURL += '/';
		return it; 
	};
}
if (!window.PathFinder){
	var PathFinder = new jQuery.PathFinder();
}

var isReady = false;
var homePageReadyCalled = false;


function GetBaseURL(){
	return PathFinder.baseURL;
}
