  //////////////////////////////
  // CONFIGURACION DE IDIOMAS //
  //////////////////////////////
    
  var idiomaActual = 1;
  var vMensajeOk = new Array(
           "Elemento aņadido al Planificador",  //es
           "Element Added to the Planning"      //en
           );

  var vMensajeError = new Array(
           "No se pudo aņadir el elemento al Planificador", //es
           "The Element can't be Added to the Planning"     //en
           );

  
  function createRequestObject() 
  {
    var ro;
    var browser = navigator.appName;
    
    if(browser == "Microsoft Internet Explorer")
    {
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    {
        ro = new XMLHttpRequest();
    }
    
    return ro;
  }
 
  var http = createRequestObject();  
 
  function sndReqAddPlanning(idioma, idl, tipo, titulo, descripcion, tStart, tEnd, duration, urll) 
  {
  	//alert('idl=' + idl +  '&type=' + tipo +  '&title=' + escape(titulo) +  '&description=' + escape(descripcion) +  '&tStart=' + escape(tStart) +  '&tEnd=' + escape(tEnd) +  '&duration=' + escape(duration) +  '&url=' + escape(urll));
    sndReq(idioma, 'idl=' + idl +  '&type=' + tipo +  '&title=' + escape(titulo) +  '&description=' + escape(descripcion) +  '&tStart=' + escape(tStart) +  '&tEnd=' + escape(tEnd) +  '&duration=' + escape(duration) +  '&url=' + escape(urll));
  }
 
  function sndReq(idioma, action) 
  {
    if ((idioma > 0) && (idioma <= vMensajeOk.length ))
      idiomaActual = idioma;
    else
      idiomaActual = 1;

    //alert('idioma=' + idioma + ' idiomaActual=' + idiomaActual +  ' action=' + action);    
    //http.open('get', 'PlanningAdd.php?'+ action);
    http.open('get', 'index.php?id=1361&'+ action);
    http.onreadystatechange = handleResponse;
    http.send(null);
  }
 
  function handleResponse() 
  {
    if(http.readyState == 4)
    {
        var response = http.responseText;
        if (http.status == 200) 
        {
            alert(vMensajeOk[idiomaActual - 1]);
        } 
        else 
        {
            alert(vMensajeError[idiomaActual - 1] + " [" + http.status + "]");                
        }        
        

    }
  }