// JavaScript Document
var Testimonials = [
  ['...In taking on Kilbrogan, Catherine and David FitzMaurice have taken on a way of life, a life they like to share.'
  +' and I am pleased with their service and results...  <br><br>  <B>Irish Examiner'],
  ['We also stayed in a wonderful find in Bandon. Kilbrogan House where you can stay in the Georgian house itself, or, as we did, in The Arches, renovated stables complete with wooden herringbone floors, crisp starched white sheets and a sublime breakfast '
  +'  <br><br>  <B>Catherine - Select Interiors Magazine'],
  ['In all of my travels and believe me I do plenty at home and abroad nowhere compares to Ireland when it comes to'
  + 'genuine hospitality and warmth. Kilbrogan has all of this in abundance! <br><br><b>Visitor from Co Antrim'],
  ['What a fine welcoming place - I would love to return, such nice touches everywhere <br><br><b>The Murdochs - England'],
  ['... an architectural gem, its ornate plasterwork carefully restored, original floor tiling exposed,'
  +' windows replaced with wooden replicas of the originals and a sunny conservatory filled with bright red geraniums... <br><br><b>Ireland of the Welcomes Magazine Article ']	// Note: no comma after last entry
];

var fileInx = 0;
var fadeCnt = 0;
var fadeInc = Testimonials.length-1;

var fadePause = 5;  // constant of seconds to display without fade
var PauseFade = 3;  // variable to modify

function dispTestimonialPause() {
  PauseFade--;
  if (PauseFade > 0) { setTimeout("dispTestimonialPause()",1000); }
                else { PauseFade = fadePause;  setTimeout("dispTestimonial()",100); }
}

function dispTestimonial () {
  document.getElementById("testimonials").innerHTML = Testimonials[fileInx]; // +'<p>'+fadeCnt;
  document.getElementById('testimonials').style.opacity = (fadeCnt/100).toFixed(2);
  document.getElementById('testimonials').style.filter = 'alpha(opacity=' + fadeCnt + ')';
  fadeCnt += fadeInc;
  var flag = false;
  if (fadeCnt >= 100) { fadeInc *= -1; flag = true; }
  if (fadeCnt <= 0)   { fadeInc *= -1;
    fileInx++;    fileInx = (fileInx % Testimonials.length);
	fileInx = Math.round(Math.random()*Testimonials.length);
  }
  if (flag) { setTimeout("dispTestimonialPause()",1000); }
       else { setTimeout("dispTestimonial()",100); }
}

window.onload = function () {
  setTimeout("dispTestimonial()", 100);
} 
