
function swapImage(imgDocID,imgObjName) {
	document.images[imgDocID].src = eval(imgObjName + ".src");
}

function doubleConfirmDelete(URL) {
	msg = "You are about to delete an item.\n\nIt is possible this item is linked to one or more places in the site.\n" +
	"Please make absolutely sure it is not used anywhere on the site before continuing.\n" +
	"If you are not sure, please click 'Cancel' and contact the webmaster (website@magicsoftware.com).\n\n" +
	"Otherwise, click 'OK'";
	
	if (confirmDelete()) var ret = confirm (msg);
	if (ret) location.href=URL;
}

function bodyOnLoad() {
	// allows other functions to add functionality //
	if (document.getElementById && location.href.indexOf('InnerPage')>-1)
	{
		var TD_spacer = document.getElementById('TD_spacer');
		if (window.screen.width<1024)
			TD_spacer.style.width = 0;
	}
}

// retrieves a URL parameter from the requst.
function getUrlParam( paramName ) {
	var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ;
	var oMatch = oRegex.exec( window.top.location.search ) ;
	
	if ( oMatch && oMatch.length > 1 )
		return oMatch[1] ;
	else
		return '' ;
}

