/************* PAGINA irlanda *************/

/*
 * Get the content of a page
 * 
 */
function getContent(method, page, args, func) {

  // Obtain an XMLHttpRequest instance
  var req = newXMLHttpRequest();

  // Set the handler function to receive callback notifications
  // from the request object
  var handlerFunction = getReadyStateHandler(req, func);
  req.onreadystatechange = handlerFunction;

  // Open an HTTP GET connection to the shopping cart servlet.
  // Third parameter specifies request is asynchronous.
  req.open(method, page, true);

  req.send(args);
}

function getItinerario()
{
  getContent("GET", "turchiaI.html", "", setItinerario);
}

function setItinerario(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getTrasporti()
{
  getContent("GET", "turchiaT.html", "", setTrasporti);
}

function setTrasporti(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getDormire()
{
  getContent("GET", "turchiaD.html", "", setDormire);
}

function setDormire(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getMangiare()
{
  getContent("GET", "turchiaM.html", "", setMangiare);
}

function setMangiare(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getNotizie()
{
  getContent("GET", "turchiaNG.html", "", setNotizie);
}

function setNotizie(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getPhoto()
{
  getContent("GET", "turchiaPG.html", "", setPhoto);
}

function setPhoto(content)
{
  document.getElementById("contenuto").innerHTML=content;
  loadGallery();
}

function getDownloads()
{
  getContent("GET", "turchiaDL.html", "", setDownloads);
}

function setDownloads(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

/************* PAGINA turchiaM *************/

function turchiaM_setIstanbul()
{
  document.getElementById("paragrafo").innerHTML='Ristorante <b>Marco Pasha</b>, in una stradina a lato della Istiklâl Caddesi, la famosa strada pedonale nel quartiere di Taksim. Cucina turca tradizionale. <br/> <b>Gila Bar</b>, all\'ultimo piano di un palazzo in Şeftali Sokak, Ateş Pasajı, vicino alla cisterna. Splendido panorama sulla città.<br/> <b>Cafe Fes</b> all\'interno del Gran Bazar in Halıcılar Caddesi No:62<br/> <b>Göze Pasta</b> pittoresca pasticceria zeppa di delizie alla fermata di Sarıyer del traghetto sul Bosforo.';
}

function turchiaM_setUchisar()
{
  document.getElementById("paragrafo").innerHTML='<b>Osmanli Cafe e Bar</b>, Per gustare un tè e provare il nargile. <br/>';
}

function turchiaM_setMustafapasa()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.pachahotel.com/">Hotel Pacha</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br />Ottimo ristorantino con atmosfera deliziosa.';
}



/************* PAGINA turchiaD *************/

function turchiaD_setIstanbul()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.hotelferhat.com/">Hotel Ferhat</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Buono. A Sultanahmet, a pochi passi dai principali monumenti di Istanbul. Ottimo prezzo trovato su Hotel Discount. Un po\' rumoroso ma pulito ed in posizione eccellente';
}

function turchiaD_setUchisar()
{
  document.getElementById("paragrafo").innerHTML='<b>Başaran Pansiyon</b>, accanto al Club Méd. Tel. 219-22-22<br />Giudizio: Ottimo. All\'uscita del villaggio, piccola pensione familiare con splendida vista sulle valli della Cappadocia. Una deliziosa famiglia vi accoglierà con ospitalità e gentilezza. Un incontro indimenticabile';
}

function turchiaD_setCirali()
{
  document.getElementById("paragrafo").innerHTML='Giudizio: Ottimo. Poco prima del campeggio sulla sinistra. Non ricordo il nome, ma il gestore si chiama Ramazan Kutle. Incredibile colazione con marmellate fatte in casa. Ma attenzione: parlano solo il turco!<br/>';
}

function turchiaD_setUcagiz()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://http://members.tripod.com/~onurpension/index.html">Onur Pension</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Ottimo. Sul mare, accanto al parcheggio. Splendide terrazze sul mare. La padrona, olandese, vi saprà indirizzare per le escursioni in barca all\'isola di Kekova';
}

function turchiaD_setBozburun()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.tatildunyasi.com/a.page/en/a.2481.html">Style Otel</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Buono. Pulito, accogliente. Il figlio del gestore, tifoso interista, può anche organizzarvi un giro sulla sua piccola imbarcazione lungo la costa';
}

function turchiaD_setDidyma()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.geocities.com/didyma_didim/newpage133.htm">Aksel Otel</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Buono. Pulito, accogliente, comodo';
}


/************* PAGINA turchiaI *************/

function turchiaI_setIstanbul()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/turchia/DublinoMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}

function turchiaI_setKilkenny()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/turchia/KilkennyMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function turchiaI_setCahir()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/turchia/CahirMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function turchiaI_setKerry()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/turchia/KerryMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function turchiaI_setAran()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/turchia/AranMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function turchiaI_setTotale()
{
  document.getElementById("paragrafo").innerHTML='<img style="padding-left: 76px; padding-right: 76px;" class="photo" src="img/turchia/turchiaMapB.jpg" height="263" width="198" alt="Map.jpg" />';
}


/************* PAGINA turchiaT *************/

function turchiaT_setIstanbul()
{
  document.getElementById("paragrafo").innerHTML='<b>Roma - Zurigo - Istanbul</b> con Swiss Air. Visita di istanbul per i successivi tre giorni.';
}

function turchiaT_setUchisar()
{
  document.getElementById("paragrafo").innerHTML='<b>Istanbul - Uçhisar</b> con pullman notturno, circa 11 ore di viaggio che ci hanno fatto risparmiare una notte in albergo. Visita della Cappadocia nei giorni seguenti con minibus privato (consigliato da Francesco), ed una giornata di trekking con Francesco ed un gruppo di italiani incontrati lì.';
}

function turchiaT_setCirali()
{
  document.getElementById("paragrafo").innerHTML='<b>Uçhisar - Antalya in pullman, poi in auto fino a Çiralı</b><br/>Abbiamo scelto questa meta su consiglio di Francesco. Ottimo consiglio: una spiaggia meravigliosa tutta per noi con acque limpide, cristalline.';
}

function turchiaT_setKekova()
{
  document.getElementById("paragrafo").innerHTML='<b>Çiralı - Üçağiz</b><br/>Scoperto per caso, questo villaggio è il luogo ideale per la visita in barca delle isole, famose per i ruderi che affiorano dalle acque cristalline. ';
}

function turchiaT_setBozburun()
{
  document.getElementById("paragrafo").innerHTML='<b>Üçağiz - Bozburun</b><br/>Seguendo la costa in macchina, ammirando paesaggi indimenticabili, siamo arrivati a Bozburun, villaggio nella penisola di Marmaris. La nostra meta inziale era Marmaris, ma non abbiamo trovato alloggio, è un paese molto turistico.';
}

function turchiaT_setDidima()
{
  document.getElementById("paragrafo").innerHTML='<b>Bozburun - Didyma</b><br/>Piccolo spostamento di riposo fino a Didyma prima della grande cavalcata finale.';
}

function turchiaT_setIzmir()
{
  document.getElementById("paragrafo").innerHTML='<b>Didyma - Izmir</b><br/>con visita ai ruderi di: Didyma, Priene, Mileto ed Efeso. Arrivo ad Izmir nel pomeriggio e grande affanno per riconsegnare la macchina entro l\'ora prestabilita. Izmir è una metropoli senza piano regolatore. Per fortuna abbiamo trovato un taxista che ci ha fatto strada fino al centro.';
}

function turchiaT_setIstanbul2()
{
  document.getElementById("paragrafo").innerHTML='<b>Izmir - Istanbul</b><br/>Una volta lasciata la macchina, viaggio notturno in pullman per tornare ad Istanbul. Altra notte in albergo risparmiata...';
}
/************* PAGINA turchiaPG *************/

var idx = 0;
var gallery = null;

function loadGallery()
{
  getContent("GET", "img/turchia/turchiaPG.txt", "", initGallery);
}

function initGallery(content)
{
  idx = 0;
  content = "(" + content + ")";
  gallery  = eval(content);

  img1 = document.getElementById("tpg.img1");
  img2 = document.getElementById("tpg.img2");
  img3 = document.getElementById("tpg.img3");
  img4 = document.getElementById("tpg.img4");
    
  set_tn(img1,gallery.imgs[0]);
  set_tn(img2,gallery.imgs[1]);
  set_tn(img3,gallery.imgs[2]);
  set_tn(img4,gallery.imgs[3]);

  img1.onclick=function() { loadGalleryImage(gallery.imgs[0+idx].titolo, gallery.imgs[0+idx].src, gallery.imgs[0+idx].sottotitolo, gallery.imgs[0+idx].didascalia, gallery.imgs[0+idx].vertical); };
  img2.onclick=function() { loadGalleryImage(gallery.imgs[1+idx].titolo, gallery.imgs[1+idx].src, gallery.imgs[1+idx].sottotitolo, gallery.imgs[1+idx].didascalia, gallery.imgs[1+idx].vertical); };
  img3.onclick=function() { loadGalleryImage(gallery.imgs[2+idx].titolo, gallery.imgs[2+idx].src, gallery.imgs[2+idx].sottotitolo, gallery.imgs[2+idx].didascalia, gallery.imgs[2+idx].vertical); };
  img4.onclick=function() { loadGalleryImage(gallery.imgs[3+idx].titolo, gallery.imgs[3+idx].src, gallery.imgs[3+idx].sottotitolo, gallery.imgs[3+idx].didascalia, gallery.imgs[3+idx].vertical); };

  loadGalleryImage(gallery.imgs[0].titolo , gallery.imgs[0].src, gallery.imgs[0].sottotitolo, gallery.imgs[0].didascalia, gallery.imgs[0].vertical);
}

function set_tn(tn,info)
{
  tn.src   = info.srcTN;
  tn.alt   = info.alt;

  if (info.vertical == "y")
  {
  	tn.style.padding='2px 20px';
  	tn.width="44";
  	tn.height="60";
  }
  else
  {
  	tn.style.padding='2px';
  	tn.width="80";
  	tn.height="60";  
  }
}

function inc_gal()
{
  if (idx+4 == gallery.imgs.length)
  {
    return;
  } 
  idx++;
  
  if (idx+4 == gallery.imgs.length)
  {
    document.getElementById("freccia_giu").style.visibility='hidden';
  }
  else
  {
    document.getElementById("freccia_su").style.visibility='visible';
    document.getElementById("freccia_giu").style.visibility='visible';
  }
  
  img1 = document.getElementById("tpg.img1");
  img2 = document.getElementById("tpg.img2");
  img3 = document.getElementById("tpg.img3");
  img4 = document.getElementById("tpg.img4");
  
  set_tn(img1,gallery.imgs[0+idx]);
  set_tn(img2,gallery.imgs[1+idx]);
  set_tn(img3,gallery.imgs[2+idx]);
  set_tn(img4,gallery.imgs[3+idx]);  
}

function dec_gal()
{
  if (idx == 0)
  {
	document.getElementById("freccia_su").style.visibility='hidden';
    return;
  } 
  idx--;
  
  if (idx == 0)
  {
	document.getElementById("freccia_su").style.visibility='hidden';
  }
  else
  {
    document.getElementById("freccia_su").style.visibility='visible';
    document.getElementById("freccia_giu").style.visibility='visible';
  }
  
  img1 = document.getElementById("tpg.img1");
  img2 = document.getElementById("tpg.img2");
  img3 = document.getElementById("tpg.img3");
  img4 = document.getElementById("tpg.img4");

  set_tn(img1,gallery.imgs[0+idx]);
  set_tn(img2,gallery.imgs[1+idx]);
  set_tn(img3,gallery.imgs[2+idx]);
  set_tn(img4,gallery.imgs[3+idx]);  
}

function loadGalleryImage(titolo, img, sottotitolo, didascalia, verticale)
{
  foto=document.getElementById("tpg.img");  
  foto.src="img/pixel.gif";
  if (verticale == "y")
  {
  	foto.style.padding='5px 77px';
  	foto.width="186";
  	foto.height="248";
  }
  else
  {
  	foto.style.padding='5px';
  	foto.width="330";
  	foto.height="248";  
  }
  foto.src=img;
  document.getElementById("tpg.titolo").innerHTML=titolo;
  document.getElementById("tpg.sottotitolo").innerHTML=sottotitolo;
  document.getElementById("tpg.didascalia").innerHTML=didascalia;    
}



