var drilledPath = null;
 
function showLinkURL(linkAnchor, tabsId, subTabId) {
	var linkBoxInput = dojo.query(".URLBox input")[0];
	var shouldShowSubTab = false;
	
	var selectedTab = dijit.byId(tabsId).selectedChildWidget;
	var selectedSubTab = null;
	var subTabset = null;
	
	if (subTabId && (subTabId != "")) {
			subTabset = dojo.query(".dijitTabContainer", selectedTab.domNode)[0];
			subTabset = (subTabset) ? dijit.byId(subTabset.id) : null;
			
			shouldShowSubTab = (subTabset != null);	 									/* Only include subTab if subtab exists under the current tab */
	}
	
	/* send the browser to that location */
	drilledPath = document.location.pathname + "?tab=" + selectedTab.id + (shouldShowSubTab ? "&subTab=" + subTabset.selectedChildWidget.id : "");
	
	linkBoxInput.value = "http://" + document.location.hostname + drilledPath;

	showURLBox();
}

function sendToNavBar() {
	document.location = drilledPath;
}

function hideURLBox() {
	var linkBox = dojo.query(".URLBox")[0];
	
	linkBox.style.display = "none";
}

function showURLBox() {
	var linkBox = dojo.query(".URLBox")[0];
	var linkBoxInput = dojo.query("input", linkBox)[0];
	
	linkBox.style.marginLeft = "-" + 383 + "px";
	linkBox.style.marginTop = "-" + 21 + "px";
	
	linkBox.style.display = "block";
	
	linkBoxInput.focus();
	linkBoxInput.select();
}