﻿// JScript Filed
function SetCurrentTestimonial()
{
  var TestimonialCell = document.getElementById("testimonialcell");
  TestimonialCell.align="center";   
  var stringHidden;     
  var stringSplit;
  var currentTestimonialIndex = document.getElementById("currenttestimonialindex");
  var index=currentTestimonialIndex.value;  
//  var recordCount = document.getElementById("recordCount").Value;
  var recordCount = 3;
//get the appropriate hidden field value and split the string to an array based on | as delimeter
// string array indices:
// 0 - Member_Comment
// 1 - Member_Name
  if (index == 0 ) stringHidden = document.getElementById("hf0").value;
  else if (index ==1) stringHidden=document.getElementById("hf1").value;
  else if (index == 2) stringHidden=document.getElementById("hf2").value;
  stringSplit = stringHidden.split("|");
  var subText=stringSplit[0] + "<dir>"+stringSplit[1]+"</dir>\n";
  TestimonialCell.innerHTML =  subText;
  index++; 
  if (index>=recordCount) index=0;
  currentTestimonialIndex.value =index;
  window.setTimeout("SetCurrentTestimonial()",10000);
}

