﻿Event.observe(window, 'load', function () {
    var testimonialArray = new Array(
    "4/7/2010~~9123456789~~C.~~Jenkins~~...Just knowing that we have a car stateside gives me a great sense of relief when PCSing.  No haggle and great incentives. You can also purchase a vehicle for here as well.  No limits to where you can pick up your new vehicle. Phill Armstrong makes purchasing a vehicle almost fun!", 
	"11/1/2008~~9102353475~~R.~~Wall~~My total experience with all your staff whether thru email or personally has been excellent. I want to commend Justin Kearney at Camp B, Iraq for all his help and work. He was very knowledgable in his product line and has a great attitude.", 
    "1/23/2009~~9102343922~~M.~~Brandenburg~~I am very satisfied with my purchase and overall it was a great experience buying from your organization. Warren (the salesman in Bamberg) did an excellent job and went the extra mile making sure everything went as planned.",
    "1/24/2009~~9102359133~~G.~~Castro~~I have bought five cars from your firm and I have been very satisfied and that is why I continously to come back. I would like to commend Mr. Jess Alvarado for his professionalism and outstanding support during all these years of dealing with your firm.",
    "2/2/2009~~9102349133~~A.~~Leung~~Sabrina Kenny, was extremely helpful and friendly, she made the whole process go very smoothly and answered all of my questions in a very timely manner. I would recommend her to anyone who was looking to make a purchase."
);
    var testimonial = testimonialArray[0].toString().split("~~");
    document.getElementById("testimonials").innerHTML = testimonial[4];
    document.getElementById("author").innerHTML = testimonial[2] + " " + testimonial[3];

    
    setInterval(switchTestimonials,5000);
    
    function switchTestimonials() {
        
        var randNum = Math.floor(Math.random()*testimonialArray.length);
        var testimonial = testimonialArray[randNum].toString().split("~~");
        document.getElementById("testimonials").innerHTML = testimonial[4];
        document.getElementById("author").innerHTML = testimonial[2] + " " + testimonial[3];

    }
});
