function invoker(indNovaJanela, parametros, _opcoes){
	var _form = document.getElementById('invokerForm');
	var _txtParametros = _form.txtParametros;
	_txtParametros.value = parametros;
	if (indNovaJanela == 0) {
		//Mesma Janela
		_form.target = "_self";
	} else if (indNovaJanela == 1) {
		//Nova Janela
		_form.target = "_blank";
	} else if (indNovaJanela == 2) {
		//Pop-Up
		var winName = "Popup" + Math.round(Math.random() * 1000000);
		var opts = "status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=yes";
		opts += parseOpcoes(_opcoes);
		
		window.open("", winName, opts);
		_form.target = winName;
	}
	NlForm.windowSize(_form);
	_form.submit();
}

function invokerPopup(_url, _opcoes){
	var winName = "Popup" + Math.round(Math.random() * 1000000);
	var opts = "status=no,toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=no";
	opts += parseOpcoes(_opcoes);
	window.open(_url, winName, opts);
}

function parseOpcoes(_opcoes){
	var opts = "";
	if (_opcoes) {
		var exp = /^(\d+)(%?)x(\d+)(%?)$/;
		var pop = exp.exec(_opcoes);
		
		var _width = new Number(pop[1]);
		var _height = new Number(pop[3]);
		if (pop[2] == "%") {
			_width = parseInt((screen.availWidth * pop[1]) / 100);
		}
		if (pop[4] == "%") {
			_height = parseInt((screen.availHeight * pop[3]) / 100);
		}
		opts = ",width=" + _width;
		opts += ",height=" + _height;
		opts += ",top=" + parseInt((screen.availHeight - _height) / 2);
		opts += ",left=" + parseInt((screen.availWidth - _width) / 2);
	}
	return opts;
}

