function rndTestimonials() {
var rand1 = 0;
var useRand = 0;
var siteid = location.pathname;

if (siteid = "/Default.aspx") {
testimonials = new Array;


testimonials[1] = '<p style="color:#FFFFFF;"><i>"After researching various learning academies in Pinellas County we found out about the Lakeside Learning Solutions programs. We needed more than tutoring for our son, a 10th grade student in a local public high school.  At the time we enrolled him at Lakeside, his reading was at the 5th grade level and you could not read his handwriting. We saw improvements begin almost immediately. First, there was improvement in his cursive writing. YOU COULD READ IT! Our son also began to improve his ability to retain information and his school performance improved considerably each semester. He just received his ACT test report and he scored in the top 25% nationally in reading! He now knows college is a real opportunity and has the self-esteem and confidence to succeed. Both of our sons will graduate from Lakeside Christian School and we are eternally grateful for the caring, dedicated and professional staff. Our only regret is we didn’t find out about Lakeside sooner."</i><br><br><b> Mr. E<br></b>';

testimonials[2] = '<p style="color:#FFFFFF;"><i>"Since enrolling our elementary age son at Lakeside we have seen improvement in his short-term memory, his ability to focus, and his writing skills. His teacher and his Educational Therapist are caring and committed to seeing their students succeed. Because of their love and concern, we have confidence our son is in good hands and his academic future is secure."</i><br><br><b>Mrs. N</b>';

testimonials[3] = '<p style="color:#FFFFFF;"><i>"Frustrated by the lack of help received at our previous school, I enrolled my 3rd grade son at Lakeside Christian School and in their Learning Solutions program. I cannot say enough good things about the program. My son’s attention, focus, recall, and grades are improving by leaps and bounds. Their teachers are amazing! God Bless the staff at Lakeside Christian for their outstanding work and commitment to their students. "</i><br><br><b>Mrs. H</b>';

testimonials[4] = '<p style="color:#FFFFFF;"><i>"I came to Lakeside in the 10th grade from a large local high school. At first, I did not like the small size but soon found the advantages. Every teacher took interest in me and found time to help me when I needed their help the most. The school work was challenging and has helped prepare me for college. School has been a struggle for me and I am glad Lakeside had the staff to support me as I caught up.  I will graduate this year with confidence to move on in life and will leave behind great friends, Teachers, Coaches, and memories.  Go Lion Football!"</i><br><br><b>Class of 2009 Graduate.</b>';

var testnum = testimonials.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((testnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
document.getElementById("testimonial").innerHTML = testimonials[useRand];
document.getElementById("testimonial").style.marginLeft="10px";
document.getElementById("testimonial").style.marginRight="10px";
document.getElementById("testimonial").style.marginTop="40px";
document.getElementById("testimonial").style.position="absolute";

document.getElementById("testimonial").style.width="160px";
document.getElementById("testimonial").style.clear="both";
}
}

window.onload = rndTestimonials;requiredfields = new Array('first_name','First Name','last_name','Last Name','email','Email Address','phone','Phone','country','Country','00N30000000wQso','Fleet Size','company','Company Name');
var country;
var state;
var first_name;
var last_name;
var phone_number;
function formrules(frm)
{


    var thisform = frm;
    var elements = document.forms['aspnetForm'].elements;
    var ret = listAllRequiredFields(elements);
    if (ret == false) {return false;}
    
        for (var x = 0;x<elements.length;x++)
        {
            if (elements[x].FieldName != undefined)
            {
                
                if (elements[x].FieldName == 'country')
                {
                    country = elements[x].value;
                }
                else if (elements[x].FieldName == 'state')
                {
                    state = elements[x].value;
                }
                else if (elements[x].FieldName == 'first_name')
                {
                    ret = badFormValue(elements[x].value);
                    if (ret == true) {alert('Invalid first name');return false;}
			first_name = elements[x].value;
                }
		else if (elements[x].FieldName == 'last_name')
		{
			last_name = elements[x].value;
		}
		else if (elements[x].FieldName == 'phone')
		{
			if (phonenumber(elements[x].value).length <= 7)
			{alert('Invalid Phone Number');return false;}

		}
		else if (elements[x].FieldName == '00N30000001DYuT')
		{
			ret = badFormValue(elements[x].value);
                    if (ret == true) {alert('Invalid content in comments box');return false;}
		}

            }
        }
        if (country == 'US' && state == '')
        {
            alert('You must select a state.')
            return false;
        }
        else if (country != 'US' && state != '')
        {
            alert('Please delete your state selection.')
            return false;
        }
if (first_name == last_name)
{
alert('invalid name');
return false;
}

if (CheckBoxSelection() == false)
{
alert('Please select an interest');
return false;
}
            
    return true;
}

function badFormValue(frmvalue)
{
    var badwords = new Array('http://*');
    for (var b = 0;b<badwords.length;b++)
    {
    var re = new RegExp(badwords[b]);
          if (frmvalue.match(re)) 
          {
            return true;
          } 
    }
return false;
}

function phonenumber(phonevalue)
{
	var p = new RegExp(/\d/g);
    var s = '';
    var match = phonevalue.match(p);
    //alert(match.length);
    for (var m=0;m<match.length;m++)
    {
    s += match[m];
    }
    //alert(s);
	return s;
}

function listAllRequiredFields(elements)
{
                for (var x = 0;x<elements.length;x++)
                {
                    for (r=0;r<requiredfields.length;r++)
                    {
                        if (requiredfields[r] == elements[x].FieldName && elements[x].value == '')
                        {
                            alert(requiredfields[r+1] + ' is required');
                            r++
                            elements[x].focus()
                            return false;
                        }
                    }
                }
return true;
}

function validateEmail(elementValue)
{ 
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
return emailPattern.test(elementValue);
 }

function CheckBoxSelection()
{
	var c = document.getElementById('00N60000001YFpD');
	if (c == null) {return true;}
	if (document.getElementById('00N60000001YFpD').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFpI').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFpN').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFpS').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFpX').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFpc').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFph').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFpr').checked == true) {return true;}
	else if (document.getElementById('00N60000001YFqE').checked == true) {return true;}
	return false;
}
