function addFieldToForm(form, name, value)
{
	if (!form) return;
	if (form[name]) return;
	var node = document.createElement("INPUT");
	node.type = "hidden";
	node.name = name;
	node.value = value;
	form.appendChild(node);
}
function do_goto(href)
{
	var action = window.Indici.VpathDestinazione + "Goto.aspx";
    if (window.location.href.indexOf(".aspx") > 0)
        action = window.Indici.VpathDestinazione + "../goto.asp";

	//var form = document.forms[0];
	
		//form.goto_username.value = window.Indici.gotoUsername;
		//form.goto_codice.value = window.Indici.gotoCodice;
		//form.goto_url.value = href;
		var form = document.createElement("FORM");
		document.body.appendChild(form);
		
		if (window.Indici && window.Indici.gotoUsername && window.Indici.gotoCodice)
	    {
		    addFieldToForm(form, "goto_username", window.Indici.gotoUsername);
		    addFieldToForm(form, "goto_codice", window.Indici.gotoCodice);
		}
		addFieldToForm(form, "goto_url", href);
				
		form.action = action;
		form.method = "post";
		form.submit();
}
