﻿initHero("home", -80, 0, -240, 190, 340);

var content_right1;
var companyContainer1;
var prodOrServ1;
var prodOrServText1;
var testimonialText1;
var testimonialName1;
var testimonialPosition1;

var content_right2;
var companyContainer2;
var prodOrServ2;
var prodOrServText2;
var testimonialText2;
var testimonialName2;
var testimonialPosition2;

var tDiv = 1;
var currentTestimonial = 1;

testimonials = new Array();

tPll = {};
tPll.companyName = "F. A. Premier League";
tPll.prodOrServ = "Service";
tPll.product = "Bespoke website";
tPll.text = "Your hard work and dedication to the sites has been greatly appreciated. I wish you every success for the future.";
tPll.by = "Kate Coleman";
tPll.position = "Education and Child Protection Manager";

tSar = {};
tSar.companyName = "Sartorius UK";
tSar.prodOrServ = "Product";
tSar.product = "Ekina Wireless";
tSar.text = "We had a business need for a mobile calibration solution. It became quite evident from the early stages of development that we had chosen the best software company to work with...";
tSar.by = "John Courtney";
tSar.position = "Quality Assurance Manager";

tAim = {};
tAim.companyName = "Aim Higher";
tAim.prodOrServ = "Service";
tAim.product = "Web-based application";
tAim.text = "...We are aware that sometimes we have asked them to respond to very tight deadlines but we have never been disappointed. Thank you Ekina, we look forward to working with you in the next few years, to help us maintain the site further...";
tAim.by = "Sharon Smith";
tAim.position = "Research &amp; Evaluation Manager";

tFr = {};
tFr.companyName = "Front Runner Logistics";
tFr.prodOrServ = "Product";
tFr.product = "Ekina Wireless";
tFr.text = "Fanastic bunch of guys, friendly, easy to work with and have always been willing to take that extra step to accommodate our needs.";
tFr.by = "Paul Molloy";
tFr.position = "Company Director";

testimonials.push(tPll);
testimonials.push(tSar);
testimonials.push(tAim);
testimonials.push(tFr);

function changeTestimonial()
{
	tDiv = tDiv == 1 ? 2 : 1;
	
	window["companyContainer"+tDiv].innerHTML = testimonials[currentTestimonial].companyName;
	window["prodOrServ"+tDiv].innerHTML = testimonials[currentTestimonial].prodOrServ + ":";
	window["prodOrServText"+tDiv].innerHTML = testimonials[currentTestimonial].product;
	window["testimonialText"+tDiv].innerHTML = '"'+testimonials[currentTestimonial].text+'"';
	window["testimonialName"+tDiv].innerHTML = testimonials[currentTestimonial].by;
	window["testimonialPosition"+tDiv].innerHTML = testimonials[currentTestimonial].position;
	
	currentTestimonial = currentTestimonial<testimonials.length-1 ? currentTestimonial+1 : 0;
}

function crossFadeTestimonial()
{
	changeTestimonial();
	//alert("testimonial" + (tDiv==1?1:2));
	$("testimonial" + (tDiv==1?1:2)).fadeIn(100, 1, null, Ekina.UI.Effects.Tween.Regular.In);
	$("testimonial" + (tDiv==1?2:1)).fadeOut(0, 1, null, Ekina.UI.Effects.Tween.Regular.Out);
	window.setTimeout("crossFadeTestimonial()", 10000);
}

Ekina.Events.register(window, "ondomready", function()
{
	content_right1 = document.getElementById("testimonial1");
	companyContainer1 = content_right1.getElementsByTagName("span")[0].getElementsByTagName("span")[1];
	prodOrServ1 = content_right1.getElementsByTagName("span")[0].getElementsByTagName("span")[2];
	prodOrServText1 = content_right1.getElementsByTagName("span")[0].getElementsByTagName("span")[3];
	testimonialText1 = document.getElementById("testimonial_text");
	testimonialName1 = document.getElementById("testimonial_name");
	testimonialPosition1 = document.getElementById("testimonial_position");
	
	content_right2 = document.getElementById("testimonial2");
	companyContainer2 = content_right2.getElementsByTagName("span")[0].getElementsByTagName("span")[1];
	prodOrServ2 = content_right2.getElementsByTagName("span")[0].getElementsByTagName("span")[2];
	prodOrServText2 = content_right2.getElementsByTagName("span")[0].getElementsByTagName("span")[3];
	testimonialText2 = document.getElementById("testimonial_text2");
	testimonialName2 = document.getElementById("testimonial_name2");
	testimonialPosition2 = document.getElementById("testimonial_position2");

	content_right2.getElementsByTagName("span")[0].getElementsByTagName("span")[0].innerHTML = "Company:";

	$("testimonial2").fadeOut(0, 1);
	
	window.setTimeout("crossFadeTestimonial()", 10000);
});
