var addBodyClass = function(){
	var pathSegments = window.location.pathname.split('/');
	var lastSegment = pathSegments[pathSegments.length - 1];
	//check if the filename part of the URL exists
	if (lastSegment.indexOf('.aspx') != -1) {
		//if the filename is index.aspx, choose the folder name as body class instead. Otherwise use the filename (stripped from the file extension)
		if (lastSegment == 'index.aspx') {
			$('body').addClass(pathSegments[pathSegments.length - 2]);
		} else {
			lastSegment = lastSegment.split('.aspx');
			$('body').addClass(lastSegment[0]);
		}
	}
}
$(document).ready(addBodyClass);