// JavaScript Document
// Specify the Testimonial files
var testimonial_content = new Array();
var testimonial_author = new Array();
var testimonial_company = new Array();
// to add more images, just continue
// the pattern, adding to the array below

// do not edit anything below this line
var testimonial_t;
var testimonial_p;
var testimonial_preLoad = new Array();

function testimonial_previous() {
	if(document.frmTestimonial.iEnd.value <= 1) {
		return false;
	}	
	for (testimonial_i=document.frmTestimonial.iStart.value;testimonial_i<document.frmTestimonial.iEnd.value;testimonial_i++)
	{	
		testimonial_author[testimonial_i]=document.frmTestimonial.iHidden[testimonial_i].value;
		testimonial_content[testimonial_i]=document.frmTestimonial.iHidden2[testimonial_i].value;
		testimonial_company[testimonial_i]=document.frmTestimonial.iHidden3[testimonial_i].value;
	}
	testimonial_p = testimonial_content.length;
	
	for (testimonial_i = 0; testimonial_i < testimonial_p; testimonial_i++) {
		if (testimonial_author[testimonial_i] == document.getElementById("testi_author").innerHTML.substr(2,document.getElementById("testi_author").innerHTML.length - 3)) {
			if (testimonial_i == 0) {
				document.frmTestimonial.iStart.value = 0;
					if(testimonial_content[testimonial_p - 1].length>260)
					{
						document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[testimonial_p - 1].substr(0,260)+"..."+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
					}
					else
					{
						document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[testimonial_p - 1]+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
					}
					document.getElementById("testi_author").innerHTML="- "+testimonial_author[testimonial_p - 1]+",";
					document.getElementById("testi_company").innerHTML=testimonial_company[testimonial_p - 1];

				return false;
			} else {
				if(testimonial_content[testimonial_i - 1].length>260)
				{
					document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[testimonial_i - 1].substr(0,260)+"..."+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
				}
				else
				{
				document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[testimonial_i - 1]+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
				}
				document.getElementById("testi_author").innerHTML="- "+testimonial_author[testimonial_i - 1]+",";
				document.getElementById("testi_company").innerHTML=testimonial_company[testimonial_i - 1];
				document.frmTestimonial.iStart.value = testimonial_i - 1;
				return false;
			}
		}
	}
}

function testimonial_next() {

	if(document.frmTestimonial.iEnd.value <= 1)
	{
		return false;
	}
	for (testimonial_i=document.frmTestimonial.iStart.value;testimonial_i<document.frmTestimonial.iEnd.value;testimonial_i++)
	{	
		testimonial_author[testimonial_i]=document.frmTestimonial.iHidden[testimonial_i].value;
		testimonial_content[testimonial_i]=document.frmTestimonial.iHidden2[testimonial_i].value;
		testimonial_company[testimonial_i]=document.frmTestimonial.iHidden3[testimonial_i].value;
	}
	
	testimonial_p = testimonial_content.length;
	
	
	for (testimonial_i = 0; testimonial_i < testimonial_p; testimonial_i++) {
		
		if (testimonial_author[testimonial_i] == document.getElementById("testi_author").innerHTML.substr(2,document.getElementById("testi_author").innerHTML.length - 3)) {
			if ((testimonial_i + 1) == testimonial_p) {
				document.frmTestimonial.iStart.value = 0;
				if(testimonial_content[0].length>260)
				{
					document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[0].substr(0,260)+"..."+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
				}
				else
				{
					document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[0]+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
				}
				document.getElementById("testi_author").innerHTML="- "+testimonial_author[0]+",";
				document.getElementById("testi_company").innerHTML=testimonial_company[0];
				
				return false;
			} else {
				if(testimonial_content[testimonial_i + 1].length>260)
				{
					document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[testimonial_i + 1].substr(0,260)+"..."+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
				}
				else
				{
					document.getElementById("testi_content").innerHTML='<img src="images/right/doble-quotes-01.gif" alt="Doble Quotes" width="14" height="11" hspace="5" vspace="4" />'+testimonial_content[testimonial_i + 1]+'<img src="images/right/doble-quotes-02.gif" alt="Doble Quotes" width="15" height="11" hspace="3" vspace="0" />';
				}
				document.getElementById("testi_author").innerHTML="- "+testimonial_author[testimonial_i + 1]+",";
				document.getElementById("testi_company").innerHTML=testimonial_company[testimonial_i + 1];
				
				document.frmTestimonial.iStart.value = testimonial_i + 1;
				return false;
			}	
		}
	}
}

//  End -->
