/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var myimages=new Array()
var xmlHttp;
//var  url="http://127.0.0.1/php5/";
var  url="http://medjugorje.altervista.org/php5/";
var risposta="---";

function preloadimages(){
    for (i=0; i < preloadimages.arguments.length; i++){
        myimages[i]=new Image()
        myimages[i].src=preloadimages.arguments[i]
    }
}

function GetXmlHttpObject()
{
xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function cambiame(data, lingua)
{
 myurl=url+"aj_mess.php?data="+data+"&l="+lingua;
 xmlHttp=new GetXmlHttpObject();
 xmlHttp.onreadystatechange = function() {

 if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
     {       
          risposta=xmlHttp.responseText;
          var bar = risposta.split("|");
          document.getElementById("MessaggioTitolo").innerHTML=bar[0];
          document.getElementById("MessaggioTesto").innerHTML=bar[1];

     }
};

 xmlHttp.open("GET",myurl,true);
 xmlHttp.send(null);
}


function cambiame2(data, lingua,dove)
{
 myurl=url+"aj_mess.php?data="+data+"&l="+lingua+"&d="+dove;
 xmlHttp=new GetXmlHttpObject();
 xmlHttp.onreadystatechange = function() {

 if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
     {
          risposta=xmlHttp.responseText;
          if (risposta != '-')
           {
          var bar = risposta.split("|");
          document.getElementById("textdata").innerHTML=bar[0];
          document.getElementById("MessaggioTitolo").innerHTML=bar[1];
          document.getElementById("MessaggioTesto").innerHTML=bar[2];
          }
     }
};

 xmlHttp.open("GET",myurl,true);
 xmlHttp.send(null);



}

function cambiame3(data,veggente, lingua,dove)
{
 myurl=url+"aj_mess_str.php?data="+data+"&l="+lingua+"&d="+dove+"&v="+veggente;
 xmlHttp=new GetXmlHttpObject();
 xmlHttp.onreadystatechange = function() {

 if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
     {
          risposta=xmlHttp.responseText;
          if (risposta != '-')
           {
          var bar = risposta.split("|");
          document.getElementById("textdatastr").innerHTML=bar[0];
          document.getElementById("MessaggioTitoloStr").innerHTML=bar[1];
          document.getElementById("MessaggioTestoStr").innerHTML=bar[2];
          }
     }
};

 xmlHttp.open("GET",myurl,true);
 xmlHttp.send(null);



}

function cambiaRdp(id,dove)
{
    myurl=url+"aj_rdp.php?id="+id+"&d="+dove;
    xmlHttp=new GetXmlHttpObject();
    xmlHttp.onreadystatechange = function() {

        if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
        {
            risposta=xmlHttp.responseText;
            if (risposta != '-')
            {
                var bar = risposta.split("|");
                document.getElementById("idrdp").innerHTML=bar[0];
                document.getElementById("MessaggioRdp").innerHTML=bar[1];
         
            }
        }
    };

    xmlHttp.open("GET",myurl,true);
    xmlHttp.send(null);



}




function cambiamestr(vegg, lingua)
{
 myurl=url+"aj_mess_str.php?v="+vegg+"&l="+lingua;
 xmlHttp=new GetXmlHttpObject();
 xmlHttp.onreadystatechange = function() {

 if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
     {
          risposta=xmlHttp.responseText;
          var bar = risposta.split("|");
		  document.getElementById("textdatastr").innerHTML=bar[0];
          document.getElementById("MessaggioTitoloStr").innerHTML=bar[1];
          document.getElementById("MessaggioTestoStr").innerHTML=bar[2];
          document.getElementById("textdatavegg").innerHTML=vegg;
          if (vegg == 'mirjana')
              document.images['immveg'].src='/img/vg/mirjana.jpg';
          if (vegg == 'ivan')
              document.images['immveg'].src='/img/vg/ivan.jpg';
          if (vegg == 'jacov')
              document.images['immveg'].src='/img/vg/jacov.jpg';
          if (vegg == 'ivanka')
              document.images['immveg'].src='/img/vg/ivanka.jpg';

     }
};

 xmlHttp.open("GET",myurl,true);
 xmlHttp.send(null);



}