var bodyFrame = window.top.pages;
var lnkMod = document.getElementById('linkModifica'); 
var lnkExitMod = document.getElementById('linkChiudiModifica'); 

function Submit(actionType)
{
  var formModifica = bodyFrame.document.getElementById('frmModifica');
	formModifica.action = getUrl(actionType)
	formModifica.method = 'POST';
	formModifica.submit();
}

function Refresh(actionType)
{
  if (actionType == 'd') {
		 if (!confirm("Rimuovere definitivamente la pagina visualizzata?")) {
		 		return;
		 }
	}
	ExecuteAction(actionType);
}
function ExecuteAction(actionType)
{
 	bodyFrame.location.href = getUrl(actionType); 	 
}

function getUrl(actionType)
{
  var url = bodyFrame.location.href;
  var regex = new RegExp('&mode=(m|d)');
  var mode = '&mode=' + actionType;
 
  return (regex.test(url) ? url.replace(regex, mode) : (url + mode));
}

