
$(document).ready(function () {
$('a.prevtestimonial').click(function () {
nextTestimonial(true);
});
$('a.nexttestimonial').click(function () {
nextTestimonial(false);
});



setInterval(nextTestimonial,12000);


//alert ("length = "+ len);
//alert (i +"="+ value);


});
var index = 0;



var testimonialsarray = [["Graeme Craig from Londonderry, Niederau","Both hotel and Rep. were excellent."],
                        ["Elisabeth Bester from Woodstock, La Plagne","Oliver was our rep and he was very helpful, always available and were able to get us a bigger apartment at High Season for a really good price ! We thought the transfers were well organised with no unnecessary delays. We were very satisfied with the holiday and look forward to join Directski again in future."],
                        ["Brian Meade from Dublin, La Plagne","this is the first time we have gone with a travel company but would do so again as it works out just as economical and without all the stress assosicated with a holiday arranged ourselves"],
                        ["Francis Donnelly from Dundalk, Arinsal","Your resort reps where excellent and being greeted by name on a daiy basis by Fiona was very pleasant. On our transfer to Toulouse, Soliel went above and beyond the all of duty to take care of all passengers Great work by Direct Ski in recruiting these ladies. "],
                        ["Vimal Gosai from London, Les Arcs","Great hassel free holiday with Directski.com! Everything went as smoothly as it possibly could."],
                        ["Margaret Kelly from Belfast, Zell Am See","We are a family of 5 , 3 skiers and 2 non skiers - had a great holiday, loved the resort and the location of the hotel. Hotel staff were excellent - friendly and helpful.Our only comment would be that the hotel should consider offering an improved wi fi service to its residents."]];


function getTestimonial (prev) {


if(prev){ 
index --;
if(index <= 0) index = testimonialsarray.length-1;
}
else {
index++;
if(index >= testimonialsarray.length) index = 0;
}


return testimonialsarray[index];
}
function nextTestimonial (prev) {
var x = getTestimonial(prev);
var name = x[0];
var txt = x[1];
$("p.testimonialactive").fadeTo('fast', 0, function() {
$(this).html(txt);
$(this).fadeTo('fast',1);
    });


$(".ns-testimonials h3.customer-name").fadeTo('fast', 0, function() {
$(this).html(name);
$(this).fadeTo('fast',1);


    });

};

