<!-----------

/*------------------------------------------------------------------------------
Replace in CADENA, all "que" with "con_que"
------------------------------------------------------------------------------*/
function xreemplaza(cadena,que,con_que)
{
var     re,newstring;
        re = new RegExp(que,"gi");
        newstring = cadena.replace(re,con_que);
        return newstring;
}

/*------------------------------------------------------------------------------
Opens a new browser window
    If no window_name, opens in same window
    If no PARAMS, assign defaults
------------------------------------------------------------------------------*/
function xabre_ventana(URL,window_name,PARAMS)
{
var     liga=xreemplaza(URL," ","+");
        // si NO trae PARAMS... los pone
        if (    (PARAMS < "0")              ||
                (PARAMS == "undefined")     )
            PARAMS="WIDTH=600,HEIGHT=500,menubar=no,status=no,scrollbars=yes,resizable=yes,right=0,left=0";
        if (window_name < "0")
        {
            window.location=liga;
        }
        else
var         new_ventana=window.open(liga,window_name,PARAMS);
        return true;
}

function submit_on_enter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
     else return true;

if (keycode == 13)
   {
   myfield.form.submit();
   return false;
   }
else
   return true;
}

//------>

