// This function return the XPath of the current web page in relation to the web site root folder
// Ex: root:/firstpage.aspx will return ""
// Ex: root:/quote/quotepage.aspx will return "../" because the quotepage.aspx is one subfolder deep from the root folder

var _relPath = "";
	
function GetPath() {
	if (_relPath == "") {
		_relPath = window.location.href.toLowerCase(); // Absolute Path of the current page
		
		aFolder = _relPath.split("/");
		n = 0;

		for (i=0; i < aFolder.length; i++) {
			if (aFolder[i].toLowerCase().indexOf("trainamproducer") >= 0) {
				i += 2;
				n = aFolder.length - i;
				break;
			}
		}

		_relPath = ""
		
		for (i=1; i <= n; i++) {
			_relPath += "../";
		} 
	}

	return _relPath;
}
