function SplitPathPage(_name) {
	var n = _name.toString();
	var page = '';
	var path = '';
	var is1 = -1;
	var is2 = n.lastIndexOf("\/");
	var isDot = n.lastIndexOf(".");
	if (is2 == n.length - 1) { // ending with '/'
		page = 'index'; // default page
		if (is2 > 0) {
			is1 = n.substring(0,is2).lastIndexOf("\/");
		}
	}
	else if (isDot > is2) { // page name
		page = n.substring(is2+1,isDot);
		if (is2 > 0) {
			is1 = n.substring(0,is2).lastIndexOf("\/");
		}
	}
	else { // no page name
		page = 'index'; // default page
		is1 = is2;
		is2 = n.length;
	}
	path = n.substring(is1+1,is2);
	return Array(path,page);
}
	
function LastPath(_name) {
	return SplitPathPage(_name)[0];
}

function BaseName(_name) {
	return SplitPathPage(_name)[1];
}

function ClickReturn() {
	var bAgent = window.navigator.userAgent; 
	var bAppName = window.navigator.appName;
	if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
		return true; // dont follow link
	else return false; // dont follow link
}

function ButtonReturn() {
	return !ClickReturn();
}
