//
// this is the popup control
// (c)2010 Tod Designs
// 
function TodShowPopup(sUrl, nWidth, nHeight){  
	if (sUrl.indexOf("http") != 0 && sUrl.indexOf("/") != 0) {
		var sBaseHref = GetDocumentBaseHref();
		sUrl = sBaseHref + sUrl;
	}  
	/******* code to always bring popup to front ******/
	newwindow = window.open(sUrl, 'ActPopup', 'width=' + nWidth + ',height=' + nHeight + ',scrollbars, resizable');
	if (window.focus) {
		newwindow.focus();
	}
	return false;
}

/***********************************************************************
*
* This is in the actiniccore.js for V10 but not available in V8/V9
*
* GetDocumentBaseHref	- Returns the href for the <base> element if it is defined
*
* Returns:	base href if defined or empty string
*
************************************************************************/

function GetDocumentBaseHref()
	{
	var collBase = document.getElementsByTagName("base");
	if (collBase && collBase[0])
	{
		var elemBase = collBase[0];
		if (elemBase.href)
		{
			return elemBase.href;
		}
	}
	return ''; 
}

