define(["dojo/_base/lang", "./Configuration"],
function(lang, Configuration) {

	var resolveUrl = function(url) {
		if (url){
			var config = new Configuration();
			//check if relative or absolute link
			var re = new RegExp('^(?:[a-z]+:)?//', 'i');
			if (re.test(url)){
				//absolute - do not prefix with context
			} else {
				//relative - prefix with context
				url = config.getContext() + url;
			}
		}
		return url;
		
	};
	

	return lang.setObject("obno.core.resources.resolveUrl", resolveUrl);
	
});