function basename(path) {
	return path.replace(/\\/g, '/').replace(/.*\//, '');
}

function dirname(path) {
	return path.replace(/\\/g, '/').replace(/\/[^\/]*$/, '');
}

$(document).ready(function() {

	var path = document.location.pathname;
	var dir = path.substr(path.indexOf('/', 0)+1, path.lastIndexOf('/'));

	$('#folders').fileTree({
		root : 'files/root/library/',
		script : '/jqueryFileTree.php'
	}, function(file) {
		openCondizioni(file);
	});

});

function openCondizioni(file) {

	window.location = "stream.php?file=" + file;
	
}

