function clearRadioDest(form) {
	form.radioDest.checked = false;
	for (var i=0; i<form.radioDest.length; i++) { form.radioDest[i].checked = false; }
}
function check_frsv01(form) {
	var page = "H";
    var url = window.location.toString();    
    if (url.indexOf("gateways")!= -1){
        page = "G";
    }  

    var codigo = "";
	//-- Radiobutton --
	if(form.radioDest.checked){ codigo = form.radioDest.value; }
	for (var i=0; i<form.radioDest.length; i++) {
	 if (form.radioDest[i].checked){
	    codigo = form.radioDest[i].value;
	    var godest = form.radioDest[i].value.split(',');
        if(godest[2]!=''){
            document.getElementById('goto').value= page+'RB-'+godest[2];
        }else{
            document.getElementById('goto').value= page+'RB-'+godest[1];
        }
	    break;
	 }
	}
	//-- Free Text --
	/*if(form.freetext.value!="")
	{
	    for(x=0;x<form.destino.length;x++)
	    {
	        nomDestino = form.destino[x].value.split(',');
	        if(nomDestino.length>2 && nomDestino[0]!="")
	        { if(nomDestino[0].toLowerCase().indexOf(form.freetext.value.toLowerCase())==0){ codigo = form.destino[x].value; } }
	    }
	}*/
	//-- ListBox --
	if(codigo=="") {
	    codigo=form.destino.value;
	    var godest = form.destino.value.split(',');

        if (godest[2]!=''){
            document.getElementById('goto').value= page +'DD-'+godest[2];
        }else{
            document.getElementById('goto').value= page +'DD-'+godest[1];
        }
	}
	if(!cargarDestino(form, codigo)) { errorear(20101); return; }	
	if(parseInt(form.nnins.options[form.nnins.selectedIndex].text,10)>0) {dinsNnis(form);return;}
	form.submit();
}

		
