//Testimonials.js
var curTestimonial;
var delay = 15000;
var testimonials = new Array(2); //Doctor, Quote, From
var novasure = new Array(2); //Doctor, Quote, From
var attachToDiv = 'Testimonials';
var selectedArray;
var timeout;

testimonials[0] = new Array('Vernon','My surgery experience was like a day at the beach!  Thank you for a job well done!', 'M.K., Dallas');
testimonials[1] = new Array('Vernon','You are the singular positive experience I recall with any physician the last many years.  And no doctor has actually sat to verbally do my health history & converse to the extent you and your assistant, Margie, did so attentively.', 'D.E., Dallas');
testimonials[2] = new Array('Vernon','I wanted to thank you again for your wonderful care.  You have walked down a difficult road with me and I am grateful for your presence.  Your calm assurance, vast knowledge and compassion have been a great comfort to me and my family... With a grateful heart,', 'M. M., Dallas');
testimonials[3] = new Array('Vernon','Your valuable expertise and insight and your trusted opinion all brought great peace of mind during the decision making process and the surgery.I hope you are well and I would love nothing more than to see and visit with you.  I get to Dallas occasionally, so maybe!', 'B., Joplin, MO');
testimonials[4] = new Array('Vernon','The quality of care you provide is exceptional.  I have never had a doctor that cared so much!  Thank you!  Sincerely,', 'J., Dallas');
testimonials[5] = new Array('Vernon','God puts special people in our lives and I am blessed that you are in mine!  (Even if it is just once a year.)  It really helps to hear from someone you trust and respect!  Thanks again -', 'C.S., Dallas');
testimonials[6] = new Array('Vernon','Thanks for everything you have done for us.  You gave us so much hope in the beginning and look at us now!  We have a family of 4!  You are our "Angel of Hope."  Thanks,', 'J.C. and T.C.');
testimonials[7] = new Array('Waldrep','I just wanted to say thank you for your help and guidance during this difficult time in our lives.  Our family holds the highest regards for you and your office.  We appreciate your taking the time to visit with us on Wednesday and for your encouraging words.  Thank you for your ongoing support.  Sincerely,', 'P.O., Fairview');
testimonials[8] = new Array('Waldrep','It was so good to be back.  I truly appreciate you seeing me.you and your staff really go above & beyond and I wanted to let you know.  I have the utmost confidence, trust, and faith in you and your practice.  With genuine appreciation,', 'J.R., Plano');
testimonials[9] = new Array('Waldrep','Thank you for helping me and providing a successful surgery.  I am amazed how much you were able to achieve with small incisions!  I am fortunate to have you as a doctor, you walk into the room and instantly provide your patients a feeling that "all will be o.k."!  Sincerely', 'C.A., Dallas');
testimonials[10] = new Array('Waldrep','Thank you for all you do.  Being pregnant with diabetes is so hard, but you make it easy with your kindness, patience, knowledge, and understanding.  D Magazine is right... you are the best doctor!  Happy Birthday!!  Love,', 'S. B., Frisco');
testimonials[11] = new Array('Waldrep','Thank you for making my pregnancy and delivery as great as you did.  Even though I do like all the other doctors you work with, I am overjoyed that you were the one who got to deliver little Alison.  Thank you for taking such good care of me.  I know I was a pain sometimes.but you still cheerfully took good care of me.  You are a wonderful doctor.  Thanks for everything!', 'K.W., Plano');
testimonials[12] = new Array('Waldrep and Staff','Thank you all for taking such good care of me during my recent surgery.  I know it is all "routine" for you all --- but for me it was frightening and stressful.  You made it as personal and comfortable as possible.  Being new to Dallas and your office, I immediately sensed and soon found out just how special Dr. Waldrep is.  I thank the Lord I was in her hands and your care.  You guys are the best.', 'J.S., Dallas');
testimonials[13] = new Array('Waldrep','We would like to express our heartfelt thanks to you for your love and support during Moms illness.  The past eighteen months have been the most difficult time of our lives, yet through it all, she remained the epitome of strength and courage.  Mom always had the utmost respect for you, both as a physician and friend, and she loved you very much.  Thanks again for being there for all of us.  Sincerely,', 'T. and N., Dallas');
testimonials[14] = new Array('Waldrep','Just a note of thanks for your wonderful handy work!  Once again, we had a wonderful childbirth experience and look forward to many more with your help.  You are a gifted doctor and a truly special person.  Thank you for your loving, personal care!  Love,', 'S.B., Parker');
testimonials[15] = new Array('Waldrep','I wanted to thank you for your concern.  It is a great feeling to have a doctor that always seems to go the extra mile!  I know I seem like a lost sheep in the midst of many life changes, but I am getting better and stronger each day.  Thank you for your support.  Sincerely,', 'D. G., Garland');
testimonials[16] = new Array('Waldrep','Thank you for being the best and for taking such good care of me!  Thank you also for talking to my daughter  -  it really made a difference to her.  Love,', 'M. W., Bermuda');
testimonials[17] = new Array('Waldrep','It has been 1 year since my surgery and I am doing better.  I know you don&#39;t usually receive anniversary cards from patients  -  probably more baby pictures  -  but we had a tough year and I appreciate your concern and good care of me!  Hope all is well with you,', 'R. M., Dallas');
testimonials[18] = new Array('Waldrep','I wanted to let you know what a wonderful job you did on my surgery!  I am so very grateful that you helped me with this problem, when no one else would.  God blessed you with the gift of medical knowledge and a giving heart!  Thank you and your staff for donating your time and efforts to me.  I know right after the surgery, I was in pain and grouchy, I do apologize and I am very grateful for your kind and caring staff and yourself!!  Thanks so much again!!', 'A.P., Garland');
testimonials[19] = new Array('Waldrep','My friend Shannon didn&#39;t realize what a gift she was giving me when she recommended you as a doctor.  No wonder you&#39;ve received so many honors and have sat in multiple leadership positions in the medical field... thank you for delivering our greatest gift from God.  There&#39;s no one else but you who I wanted to deliver all our children.  However, we just moved to Colorado Springs!  If I find a doctor up here who is half as exceptional as you are, then I will be blessed... Sincerely,', 'C. D., Colorado Springs, Colorado');
testimonials[20] = new Array('Waldrep','Beginning with my first appointment with Dr. Waldrep I knew I had found an exceptional doctor who listens to her patients. In 40 years of being treated by numerous physicians, I have not experienced the feeling of being cared for like I do with Dr. Waldrep and her staff, especially Jan.  The practice as a whole continues to treat me like a family member, not a name on a chart.  Dr. Waldrep follows up on the plans she establishes for me which gives me comfort of knowing I am in good hands at all times.  Thank you,', 'BJ, Dallas');
testimonials[21] = new Array('Waldrep','I just wanted you to know how pleased I am with the results that I have had since being on the PFM Rehabilitation Therapy program.  I had stopped taking Detrol after a month of treatments and that has been of great relief to me since I do not like taking pills, not to mention the expense.  I have not had any accidents or leaks much to my relief.  Thank you and your wonderful nurse,', 'A.A., Dallas');
testimonials[22] = new Array('Elmquist','Thank you for always having a smile on your face at every appointment.  I always looked forward to my appointments with you and you did an amazing job delivering my baby!  Thank you for being so wonderful,','K.D., Dallas');
testimonials[23] = new Array('Elmquist, Mary, and the entire staff at Vernon &amp; Waldrep OB-Gyn Assoc.','We would like to say "Thank You" for helping us to bring a healthy baby boy into our family.  At our 22 week sonogram, the B. Family discovered that we were having a little boy.  On that day, we named him A.J.   While waiting for his arrival, our daughter, E., welcomed A. by reading him stories, singing songs &amp; giving him (and mommy’s tummy) lots of kisses.  She liked to hear her brother’s heartbeat & visit with Dr. Elmquist.  Little A. was born on May 31st.  E. met her brother shortly after &amp; was in tears as she left the hospital because she wanted him to come home with her right away!!  For the rest of our lives, we will be able to tell stories such as this one, stories about A., his sister E., and their adventures together.  You have given us two precious children.  How could we possibly find words to say thank you for such an amazing gift.  We are so grateful for your expertise &amp; support.  And as we watch our family grow, please know that you will always be in our hearts.  Sincerely,','K. B., Dallas');
testimonials[24] = new Array('Elmquist, Mary and Jerri','I just wanted to take this time to thank you for the wonderful care you have given K. and E.  At every visit, you treated K. like she was family, showing nothing but tenderness and love.  I know that you have many patients, but you made K (and me) feel like we were your only concern.  While I will miss the happy anticipation associated with the monthly/weekly visits to your office, you have helped give me a beautiful, health daughter who will give me a lifetime of love, pride, and joy.  I cannot completely express what your actions mean to me, but I can thank you from the bottom of my heart for all you have done.','J. B., Dallas');
testimonials[25] = new Array('Elmquist','In Amharic (Ethiopian Language) - Let God Prosper Your Life!  Thank you so much for your kind and sincere service.  Yours,','S and S');
testimonials[26] = new Array('Elmquist','Thank you so much for all that you do.  You are such a wonderful, caring, special and awesome doctor.  Thanks for helping us deliver all our wonderful kids!  With Love,','G.A.');
testimonials[27] = new Array('Elmquist','Thank you very much for the medical care, attention and kindness.  You are a wonderful person!  Love,','R.S. and Y.S.');
testimonials[28] = new Array('Elmquist','We want to thank you so much for your kindness over the past two weeks.  This has been an emotional situation for me and my family, and one we didn’t expect.  Although it is something you probably encounter often, you treated me with compassion, kindness and sincerity.  We just wanted you to know how much your help meant to us and what a special person you are.  M. and I really liked Dr. O.!  The D & C went well and I am recovering with no problems.  Thank you again for everything.  Sincerely,','J.B. and M.B.');

novasure[0] = new Array('Waldrep','Best thing I ever did."  My husband wonders why I didn’t do it sooner.','P.H., Dallas');
novasure[1] = new Array('Waldrep','NovaSure is a wonderful procedure…would recommend it to anyone.  I only spot for about 2 days each month now rather than the hemorrhaging I used to do.','D.L., Richardson, TX');


function initTestimonials(arr){
	selectedArray = arr;
	addTestimonials(selectedArray);
	
	curTestimonial = Math.floor(Math.random()*(selectedArray.length));
	
	//Hide all other images except for the currentImage
	for(k=0;k<selectedArray.length;k++){
		if(k != curTestimonial) hide('Testimonial_'+k);
	}
	
	timeout = setTimeout('nextTestimonial()', delay);
}

function nextTestimonial(){
	try
	{
		clearTimeout(timeout);
		hide('Testimonial_'+curTestimonial);
		
		curTestimonial = Math.floor(Math.random()*(selectedArray.length));
		show('Testimonial_'+curTestimonial);
		
		timeout = setTimeout('nextTestimonial()', delay);
		return false;
	}
	catch(ex){}
}

function addTestimonials(arr) {
	for(i=0;i<arr.length;i++){
		var newdiv = document.createElement('div');
		newdiv.setAttribute('id','Testimonial_'+i);
		//newdiv.style.zIndex = (arrTestimonials.length-i)+50;
		newdiv.innerHTML = "Dr. " + arr[i][0] + ",<p>" + arr[i][1] + "</p>" + arr[i][2];
		document.getElementById(attachToDiv).appendChild(newdiv);
		
		newdiv.style['marginLeft'] = '35px';
	}
}
