/************* 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", "irlandaI.html", "", setItinerario);
}

function setItinerario(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getTrasporti()
{
  getContent("GET", "irlandaT.html", "", setTrasporti);
}

function setTrasporti(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getDormire()
{
  getContent("GET", "irlandaD.html", "", setDormire);
}

function setDormire(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getMangiare()
{
  getContent("GET", "irlandaM.html", "", setMangiare);
}

function setMangiare(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getNotizie()
{
  getContent("GET", "irlandaNG.html", "", setNotizie);
}

function setNotizie(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

function getPhoto()
{
  getContent("GET", "irlandaPG.html", "", setPhoto);
}

function setPhoto(content)
{
  document.getElementById("contenuto").innerHTML=content;
  loadGallery();
}

function getDownloads()
{
  getContent("GET", "irlandaDL.html", "", setDownloads);
}

function setDownloads(content)
{
  document.getElementById("contenuto").innerHTML=content;
}

/************* PAGINA irlandaM *************/

function irlandaM_setDublino()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.boxtyhouse.ie/">Boxty House</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Boxty House a Temple Bar. Ottimi gli stufati.';
}

function irlandaM_setWaterville()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.butlerarms.com/waterville.html">Fishermans bar</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Non è nostra abitudine mangiare italiano all\'estero, ma siamo capitati per caso in questo pub con cuoco esperto di cucina italiana. Spettacolare il crostino con pesto, tonno e formaggio.';
}

function irlandaM_setTralee()
{
  document.getElementById("paragrafo").innerHTML='In attesa del pullman per Liscannor, abbiamo fatto colazione in un bar \'femminista\' a Tralee. Bella atmosfera e splendida colazione irlandese. Purtroppo non ricordiamo il nome, ma è sulla via principale.';
}

function irlandaM_setDingle()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.frommers.com/destinations/dinglepeninsula/D44605.html">An Café Liteartha</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Delizioso caffè/libreria nel centro di Dingle.';
}


/************* PAGINA irlandaD *************/

function irlandaD_setKilkenny()
{
  document.getElementById("paragrafo").innerHTML='<b>Tir na nog</b><br/>Giudizio: Eccellente. Appena fuori Kilkenny, a 5 min. a piedi dal centro. Ottima ospitalità e colazione abbondante.';
}

function irlandaD_setCahir()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.killaunbandb.com/">Killaun B&B</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Eccellente. Appena fuori Cahir, a 5 min. a piedi dal centro. La proprietaria riuscirà a farvi sentire a casa vostra.';
}

function irlandaD_setKillarney()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.larkfieldhouse.com/">Larkfield House</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Eccellente. Fuori dal centro, ma i proprietari verranno a prendervi alla stazione dei pullman e vi riaccompagneranno in centro. Ottimo punto di partenza per le escursioni nei dintorni. I proprietari vi sapranno dare tutte le indicazioni necessarie per godervi lo splendido Parco Nazionale.';
}

function irlandaD_setWaterville()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.ireland-bnb.net/display.html?id=111">Klondyke House</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Ottimo. Fuori dal centro ma comunque raggiungibile a piedi in pochi minuti. Pulito ed accogliente.';
}

function irlandaD_setDingle()
{
  document.getElementById("paragrafo").innerHTML='<a target="new" href="http://www.devanesbandb.com/">Devane\'s</a><img style="margin: 0; border: 0; padding: 0;" src="img/Arrow.gif"><br/>Giudizio: Eccellente. Centrale, accogliente.';
}

function irlandaD_setLiscannor()
{
  document.getElementById("paragrafo").innerHTML='<b>Ostello Liscannor</b><br/>Giudizio: Ottimo. Ostello con camere da due e quattro letti ed uno spazio per i campeggiatori. Spartano ma pulito, accogliente, tranquillo, non c\'è il casino tipico degli ostelli. Il proprietario vi farà sentire a casa. Fatevi indicare la strada per raggiungere a piedi le Cliffs of Moher, ma non fate come noi: seguite le sue indicazioni!!!';
}


/************* PAGINA irlandaI *************/

function irlandaI_setDublino()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/irlanda/DublinoMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}

function irlandaI_setKilkenny()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/irlanda/KilkennyMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function irlandaI_setCahir()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/irlanda/CahirMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function irlandaI_setKerry()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/irlanda/KerryMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function irlandaI_setAran()
{
  document.getElementById("paragrafo").innerHTML='<img class="photo" src="img/irlanda/AranMapB.jpg" height="263" width="350" alt="Map.jpg" />';
}
function irlandaI_setTotale()
{
  document.getElementById("paragrafo").innerHTML='<img style="padding-left: 76px; padding-right: 76px;" class="photo" src="img/irlanda/IrlandaMapB.jpg" height="263" width="198" alt="Map.jpg" />';
}


/************* PAGINA irlandaT *************/

function irlandaT_setDublino()
{
  document.getElementById("paragrafo").innerHTML='<b>Sabato 16 agosto 2003:</b><br/>Roma - Brusselles - Dublino con Ryan Air <br/><b>Lunedì 18 1° trasferimento:</b><br/>Dublino - Kilkenny';
}

function irlandaT_setKilkenny()
{
  document.getElementById("paragrafo").innerHTML='<b>Martedì 19:</b><br/>Kilkenny - Thomastown in treno, poi un passaggio dalla stazione all\'Abbazia di Jerpoint. Di nuovo un passaggio fino al paese di Thomastown ed un pullman locale per tornare a Kilkenny.<br/><b>Mercoledì 20: 2° trasferimento</b><br/>Kilkenny - Cahir';
}

function irlandaT_setCahir()
{
  document.getElementById("paragrafo").innerHTML='<b>Giovedì 21: 3° trasferimento</b><br/>Cahir - Cashel - Cahir la mattina, poi dopo pranzo partenza per Killarney via Cork';
}

function irlandaT_setKillarney()
{
  document.getElementById("paragrafo").innerHTML='<b>Venerdì 22: 4° trasferimento</b><br/>Killarney - Waterville con il pullman che fa il giro del Ring of Kerry. Ci siamo fermati a Waterville per fare a piedi il giro della punta della penisola, detta Skellig Ring, con bagno nell\' oceano. Fatelo solo se siete allenati, è un giro abbastanza lungo. Perfetto per la bicicletta a parte una salita un po\' ripida.';
}

function irlandaT_setWaterville()
{
  document.getElementById("paragrafo").innerHTML='<b>Domenica 24: 5° trasferimento</b><br/>Waterville - Dingle via Killarney e Tralee';
}

function irlandaT_setDingle()
{
  document.getElementById("paragrafo").innerHTML='<b>Martedì 26: 6° trasferimento</b><br/>Dingle - Liscannor';
}

function irlandaT_setLiscannor()
{
  document.getElementById("paragrafo").innerHTML='<b>Giovedì 28: 7° trasferimento</b><br/>Dopo la camminata fino alle Cliffs of Moher e la biciclettata alle Isole Aran, giornata di riposo e shopping nel paesino di Lahinch.';
}

function irlandaT_setLiscannor2()
{
  document.getElementById("paragrafo").innerHTML='<b>Venerdì 29: 8° trasferimento</b><br/>Liscannor - Dublino via Limerick <br/><b>Sabato 30:</b><br/>Dublino - Londra con Ryan Air<br/>Londra - Roma con Easy Jet';
}

function irlandaT_setLiscannor3()
{
  document.getElementById("paragrafo").innerHTML='Numeri utili per muoversi in Taxi nei dintorni di Liscannor:<br>Stephen: 087 9817101<br>Creedon: 086 2478049<br>Micky Joe: 087 6224079<br>Jimmy\'s: 086 8139090';
}


/************* PAGINA irlandaPG *************/


var idx = 0;
var gallery = null;

function loadGallery()
{
  getContent("GET", "img/irlanda/irlandaPG.txt", "", initGallery);
}

function initGallery(content)
{
  idx = 0;
  content = "(" + content + ")";
  gallery  = eval(content);

  img1 = document.getElementById("ipg.img1");
  img2 = document.getElementById("ipg.img2");
  img3 = document.getElementById("ipg.img3");
  img4 = document.getElementById("ipg.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("ipg.img1");
  img2 = document.getElementById("ipg.img2");
  img3 = document.getElementById("ipg.img3");
  img4 = document.getElementById("ipg.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("ipg.img1");
  img2 = document.getElementById("ipg.img2");
  img3 = document.getElementById("ipg.img3");
  img4 = document.getElementById("ipg.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("ipg.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("ipg.titolo").innerHTML=titolo;
  document.getElementById("ipg.sottotitolo").innerHTML=sottotitolo;
  document.getElementById("ipg.didascalia").innerHTML=didascalia;    
}



