/**
This UI Script holds client script side methods that are invoked automatically when Service Portal's theme is loaded.
Define your own method and append it to the invocation stack.
**/
jQuery(document).ready(function() {
	setTimeout(function() {
		
		parseURLandRemoveSuperfluousSlash();
		// ADD MORE HERE...
		
		
		
	}, 500); // additional waiting time to wait all the components of the page to correctly load.
	
});


/**
This parses the URL when ANY service portal page is loaded (better said: when the Service Portal CERN theme is loaded).
It removes an additional slash ('/') that may appear in the end of ".../service-portal" resource of the URL.
Removing the additional slash causes a refresh of the page in the browser.
*/
function parseURLandRemoveSuperfluousSlash() {
	if (top.location.pathname.indexOf("/service-portal/") != -1) {
		top.location.pathname = "/service-portal"; // pruned the last character of the string (that is, remove the slash, '/')
	}
}