Utils = {
	basename: function (path, suffix) {
	    // http://kevin.vanzonneveld.net
	    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	    // +   improved by: Ash Searle (http://hexmen.com/blog/)
	    // +   improved by: Lincoln Ramsay
	    // +   improved by: djmix
	    // *     example 1: basename('/www/site/home.htm', '.htm');
	    // *     returns 1: 'home'
	 
	    var b = path.replace(/^.*[\/\\]/g, '');
	    
	    if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) {
	        b = b.substr(0, b.length-suffix.length);
	    }
	    
	    return b;
	},

	dirname: function (path) {
	    // http://kevin.vanzonneveld.net
	    // +   original by: Ozh
	    // +   improved by: XoraX (http://www.xorax.info)
	    // *     example 1: dirname('/etc/passwd');
	    // *     returns 1: '/etc'
	    // *     example 2: dirname('c:/Temp/x');
	    // *     returns 2: 'c:/Temp'
	    // *     example 3: dirname('/dir/test/');
	    // *     returns 3: '/dir'
	    
	    return path.replace(/\\/g,'/').replace(/\/[^\/]*\/?$/, '');
	},
	
	popup: function(href, name, height, width) {
		var height = height.toInt();
		var width = width.toInt();
		var top = (Math.round((screen.availHeight - height) / 2)).toInt();
		var left = (Math.round((screen.availWidth - width) / 2)).toInt();
		
		var popup = window.open(href, name, 'toolbar=0,location=0,directories=0,status=0, scrollbars=1,resizable=1,menubar=0,top=' + top + ',left='+left+',width='+width+',height='+height);
		return popup;
	}
}
