function inserisci_dove_sta_il_cursore(campo,pezzo,finestra) 
    {    
    //finestra puņ essere window oppure window.opener
        
    //IE
    if (finestra.document.selection) 
        {
        campo.focus();
        //creo un range di testo lungo zero e lo
        //sostituisco con il markup
        sel = finestra.document.selection.createRange();
        sel.text = pezzo;
        }

    //Mozilla/Firefox/Netscape 7
    else if (campo.selectionStart || campo.selectionStart == "0") 
        {
        //trovo i punti di inizio e fine della selezione            
        var startPos = campo.selectionStart;
        var endPos = campo.selectionEnd;
                
        //concateno
        campo.value = campo.value.substring(0, startPos)+pezzo+campo.value.substring(endPos, campo.value.length);
        }
    else 
        {
        campo.value+=pezzo;
        }
    }
function getCheckedValue(radioObj) {
    //preso da http://www.somacon.com/p143.php
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
    