function en_web(en_url,titulo) { 
  pagina = en_url;
  window.open(pagina,titulo,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=400");
}
function estado(nomb){
  obj = document.getElementById(nomb);
  if( obj.style.display != '' ){
    obj.style.display='';
  }else{
    obj.style.display='none';
  }
}
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'es'}, 'google_translate_element');
}

function esconde() {
  if(ns){
    document.pregarga.visibility="hide";
  }else{
    document.getElementById('precarga').style.visibility="hidden";
  }
}

function cargaContenido(url, metodo, funcion) {
  peticion_http = inicializa_xhr();
 
  if(peticion_http) {
    peticion_http.onreadystatechange = funcion;
    peticion_http.open(metodo, url, true);
    peticion_http.send(null);
  }
}
 
function inicializa_xhr() {
  if(window.XMLHttpRequest) {
    return new XMLHttpRequest();
  }
  else if(window.ActiveXObject) {
    return new ActiveXObject("Microsoft.XMLHTTP");
  }
}

function muestratiempo() {
  if(peticion_http.readyState == READY_STATE_COMPLETE) {
    if(peticion_http.status == 200) {
      var texto;
      texto=peticion_http.responseText;
      document.getElementById('prevision').innerHTML=texto;
    }
  }
}

function tiempo(codigo) {
  cargaContenido("/el_tiempo.js?codigos=" + codigo , "GET", muestratiempo);
}
function link(id) {
  cargaContenido(id , "GET", null);
}

