/**
 * submit a custom scale value using the existing scale system
 * @param event
 */
function setCustomScale(event){
    if (typeof(Prototype) == 'undefined'){
      alert('Warning, the javascript prototype library is not loaded! Freescale wont work.');
    } else {
        if (event == "select" || parseInt(event.keyCode) == parseInt(Event.KEY_RETURN)) {
            var scaleSelect = xGetElementById('recenter_scale').value;
            //var customScale = xGetElementById('custom_scale').value;
            if(isNaN(parseInt(scaleSelect))){
                alert('Escala no valida');
            } else {
                scaleSelect = parseInt(scaleSelect);
                if(scaleSelect > 1){
                //scaleSelect[scaleSelect.selectedIndex].value = customScale;  esto es para asignar al combo el valor custom
                    xGetElementById('recenter_doit').value=1;
                    CartoWeb.trigger('Location.Zoom', 'FormItemSelected()');
		    xGetElementById('recenter_doit').value=0;
                } else {
                    alert('invalid scale');
                }
            }
	    if(event != "select")
            	Event.stop(event);
        }
    }
}

