// JavaScript Document
 
	
	
	// JavaScript Document

$(document).ready(function() {
	if (document.getElementById('slideshow').children.length>2){
			  $('#slideshow').cjFlashySlideShow({
				 preset: "cubism"
		  });
		  captions.change(0);
	}
	else {
		vidTimeout=setTimeout("changeToSlideshow()", 38000);
	}
	
	if (BrowserDetect.browser=="Explorer" && BrowserDetect.version<=7) {
			$(document).pngFix();
		}
});
function changeToSlideshow () {
document.getElementById('slideshow').innerHTML="<img id='solid-pic' src='http://painreliefteam.com/images/banner2rev4.jpg' style='opacity:0;'/>";

$('#slideshow').animate({height: 389}, 1000);
$('#solid-pic').animate({opacity: 1}, 1000);
$('#left').animate({marginTop: 238}, 1000);
$('#right').animate({marginTop: 398}, 1000);
}

function space_gal () {
	$('#newID').click(); 
}
function button_active (obj, over) {
	if (over) {
	obj.childNodes[0].style.opacity="1";
	}
	else {
		obj.childNodes[0].style.opacity="0";
	}
}

function button_click (num, obj) {
	obj.childNodes[0].style.opacity="1";
	var obj=obj.parentNode.parentNode;
	if (num==1) {
		obj.style.height="410px";
		$('#services_details').animate({scrollLeft: 0}, 1500); 
		$('#services_changes').animate({scrollTop: 470}, 1500);
	}
	if (num==2) {
		obj.style.height="410px";
		$('#services_details').animate({scrollLeft: 450}, 1500);
		$('#services_changes').animate({scrollTop: 985}, 1500); 
	}
	if (num==3) {
		obj.style.height="410px";
		$('#services_details').animate({scrollLeft: 880}, 1500); 
		$('#services_changes').animate({scrollTop: 1490}, 1500); 
	}
	if (num==4) {
		obj.style.height="410px";
		$('#services_details').animate({scrollLeft: 1320}, 1500); 
		$('#services_changes').animate({scrollTop: 1980}, 1500); 
	}
	if (num==5) {
		obj.style.height="410px";
		$('#services_details').animate({scrollLeft: 1760}, 1500); 
		$('#services_changes').animate({scrollTop: 2520}, 1500); 
	}
	if (num==6) {
		obj.style.height="370px";
		$('#services_details').animate({scrollLeft: 2200}, 1500); 
		$('#services_changes').animate({scrollTop: 3100}, 1500); 
	}
}


function linkScroll(num) {
	if (num==1) {
		$.scrollTo({top:0, left:0},1700);
		window.location="http://www.trugosip.com";
		
	}
	if (num==2) {
		$.scrollTo({top:800, left:0},1300);
		window.location="http://www.trugosip.com/#who";
	}
	if (num==3) {
		$.scrollTo({top:1350, left:0}, 1300);
		window.location="http://www.trugosip.com/#what";
	}
	if (num==4) {
		$.scrollTo({top:1950, left:0}, 1300);
		window.location="http://www.trugosip.com/#testimonies";
	}
	if (num==5) {
		$.scrollTo({top:2535, left:0}, 1300);
		window.location="http://www.trugosip.com/#why";
	}
	if (num==6) {
		$.scrollTo({top:3100, left:0}, 1300);
		window.location="http://www.trugosip.com/#community";
	}
	if (num==7) {
		$.scrollTo({top:3500, left:0}, 1300);
		window.location="http://www.trugosip.com/#faq";
	}
	if (num==8) {
		$.scrollTo({top:3900, left:0}, 1300);
		window.location="http://www.trugosip.com/#patientEd";
	}
	if (num==9) {
		$.scrollTo({top:4700, left:0}, 1300);
		window.location="http://www.trugosip.com/#contact";
	}
}


var signup = {
	open: function (obj) {
		obj.style.left="0px";
	},
	close: function (obj) {
		obj.style.left="-150px";
	}, 
	form: function (obj) {
		obj.setAttribute('onclick','');
		obj.style.background="#666";
		obj.innerHTML="<br><br><p style='text-align:center' ><form id='signupForm'><input type='text' size='20' name='firstName' placeholder='First Name'/><br><input type='text' size='20' name='lastName' placeholder='Last Name'/><br><input type='text' size='20' name='email' placeholder='Email'/><br><input type='text' size='20' name='phoneNumber' placeholder='Phone Number (optional)'/><br><input type='text' size='20' name='Gender' placeholder='Gender'/><br><input type='text' size='20' name='Pain' placeholder='List your health concerns'/><br><input type='button' onclick='signup.finish(event)' value='submit'/></p></form>";
		
	},
	finish: function  (e) {
		var obj=document.getElementById('signupForm');
		obj.style.padding="10px";
		obj.innerHTML="<p style='font-size:2em; font-family:Arial, Helvetica, sans-serif; color:#fff; text-align:center; font-weight:bold;'>Thank You</p><p style='font-size:.8em; font-family:Arial, Helvetica, sans-serif; color:#fff; text-align:center;'>Please check your email inbox to confirm your sign-up.</p>";
		return false;
	}
}

function article_hover (obj, num) {
	var source=obj.children[0].src;
	var sliced=source.split(".");
	/*
	if (num==1) {
		$(obj).children(':last').animate({opacity: 1}, 100);
	}
	if (num==2) {
		$(obj).children(':last').animate({opacity: 0}, 100);
	}*/
}

function FAQ_switch (num) {
	var obj=$('#answers');
	if (num==1) {
		obj.animate({scrollTop: 140}, 1500);
	}
	if (num==2) {
		obj.animate({scrollTop: 295}, 1500);
	}
	if (num==3) {
		obj.animate({scrollTop: 420}, 1500);
	}
	if (num==4) {
		obj.animate({scrollTop: 535}, 1500);
	}
	if (num==5) {
		obj.animate({scrollTop: 655}, 1500);
	}
	if (num==6) {
		obj.animate({scrollTop: 770}, 1500);
	}
	if (num==7) {
		obj.animate({scrollTop: 890}, 1500);
	}
	if (num==8) {
		obj.animate({scrollTop: 1015}, 1500);
	}
	if (num==9) {
		obj.animate({scrollTop: 1140}, 1500);
	}
	if (num==10) {
		obj.animate({scrollTop: 1240}, 1500);
	}
	if (num==11) {
		obj.animate({scrollTop: 1330}, 1500);
	}
	if (num==12) {
		obj.animate({scrollTop: 980}, 1500);
	}
}
var test_count=0;
function change_test () {
	var obj=$('#success_pics');
	var obj2=$('#success_stories');
	
	if (test_count==0) {
		obj.animate({scrollTop: 150}, 1500);
		obj2.animate({scrollTop: 170}, 2000);
		test_count++;
	}
	else if (test_count==1) {
		obj.animate({scrollTop: 300}, 1500);
		obj2.animate({scrollTop: 320}, 2000);
		test_count++;
	}
	else if (test_count==2) {
		obj.animate({scrollTop: 0}, 1500);
		obj2.animate({scrollTop: 0}, 2000);
		test_count=0;
	}
	
}

var doctors={
	show: function() {
		$('#doctors_specialists').animate({opacity: 1, marginLeft: 70}, 1500);
		$('#dscr').animate({opacity: 0}, 1500);
	},
	hide: function() {
		$('#doctors_specialists').animate({opacity: 0, marginLeft: -340}, 1500);
		$('#dscr').animate({opacity: 1}, 1500);
	}
	
}

function change_info(num) {
	switch (num) {
		case 1: $('#patient_ed_section').animate({scrollTop: 0}, 1500);
				$('#gobacks').children(':last').animate({opacity: 1}, 1500);
		break;
		case 2:	$('#patient_ed_section').animate({scrollTop: 730}, 1500);
				$('#gobacks').children(':first').animate({opacity: 1}, 1500);
				document.getElementById('gobacks').children[1].children[0].setAttribute('onclick','change_info(4)');
				$('#gobacks').children(':last').animate({opacity: 1}, 1500);
		break;
		case 3:	$('#patient_ed_section').animate({scrollTop: 350}, 1500);
				$('#gobacks').children(':last').animate({opacity: 0}, 1500);
				document.getElementById('gobacks').children[1].children[0].setAttribute('onclick','change_info(3)');
				$('#gobacks').children(':first').animate({opacity: 0}, 1500);
		break;
		case 4:	$('#patient_ed_section').animate({scrollTop: 1000}, 1500);
				$('#gobacks').children(':last').animate({opacity: 0}, 1500);
				$('#gobacks').children(':first').animate({opacity: 1}, 1500);
		break;
		
	}
}

var doctor= {
	expand: function (obj) {
				$(obj).animate({height: 110}, 500);
				$(obj).children(':first').animate({opacity: 1}, 500);
	},
	contract: function (obj) {
				$(obj).animate({height: 80}, 500);
				$(obj).children(':first').animate({opacity: 0}, 500);
	}
}

function doc_deets (num) {
	$('#specialist_details').animate({height:200}, 60);
	switch (num) {
		case 0:	$('#specialist_details').stop().animate({opacity: 0, marginLeft: -440}, 1500);
				$('#doctors_specialists').stop().animate({opacity: 1, marginLeft: 0}, 1500);
				break;
		case 1:	document.getElementById('specialist_details').children[0].src="images/Specialists/jeff.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. Jeffery Spina<br>Chiropractor<br></b>has been practicing in Middletown since 1985. He was trained in Atlanta, Georgia from 1980 until 1985 when he moved to Middletown. Since 1985 Dr. Spina has helped people with all types of conditions. From back pain to neck pain, headaches to sciatica.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 2:	document.getElementById('specialist_details').children[0].src="images/Specialists/reggie.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. Reggie<br>Chiropractor<br></b> he has been practicing in Middletown since 1990. Dr.Reggie has expertise and vast experience in treating people who have been involved in accidents and injuries.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 3:	document.getElementById('specialist_details').children[0].src="images/Specialists/dave.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. David Spina<br>Chiropractor<br></b> graduated from Life Chiropractic College in Atlanta Georgia in 1991 and for several years has been practicing in Liberty New York with his father, a chiropractor for 50 years.Dr. David enjoys working with his patients and has a real innate desire to help and serve people.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 4:	document.getElementById('specialist_details').children[0].src="images/Specialists/steve.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. Steve<br>Chiropractor<br></b> was introduced to chiropractic care in high school when he was treated for an injury. He saw the success of chiropractic as a healing art, that he decided to take it up as a profession. After graduating from New Paltz College, he went on to study at the New York Chiropractic College where he graduated in 1998.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 5:	document.getElementById('specialist_details').children[0].src="images/Specialists/kanter.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. Mirriam Kanter<br>Medical Doctor<br></b>Practicing for over 10 years, owns Middletown Physical Medicine & Rehabilitation, P.C. She is Board Certified in Physical Medicine and Rehabilitation and is a NY State Certified Acupuncturist. She received her training at Sackler School of Medicine, North Shore University and Albert Einstein Hospitals.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 6:	document.getElementById('specialist_details').children[0].src="images/Specialists/garcia.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. Herbert Garcia<br>Medical Doctor<br></b> He focuses on treating musculoskeletal injuries from sprains and strains to muscle, bone and joint conditions. Dr. Garcia finds that conventional medicine in conjunction with hands-on therapy and manipulation make a big difference in the treatment of a patient's condition.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 7:	document.getElementById('specialist_details').children[0].src="images/Specialists/Lea.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Lea Robles<br>Physical Therapist<br></b> She treats patients suffering from musculoskeletal ailments.  For the past 8 years she has specialized in therapy of the back, neck, shoulder, knee and wrist, providing physical therapy to pediatric, and arthritic patients.  Lea also uses strengthening and endurance exercises as part of her patients' rehabilitation program.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 8:	document.getElementById('specialist_details').children[0].src="images/Specialists/arylnn.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Arlynn Reyes<br>Physical Therapist<br></b> She had 5 years of Physical Therapy training and 7 years of hospital experience before she moved to New York. She spent several years working in orthopedic clinics where she successfully gets her patients out of pain and back on their feet.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 9:	document.getElementById('specialist_details').children[0].src="images/Specialists/sunny.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Sunny Wade<br>Physical Assistant/ Acupuncture<br></b> was born and raised in China, and worked as a school teacher before coming to the Unites States in the 80's. Her desire to increase her knowledge and help people made her go back to school to be a physician assistant. She graduated in 1990 and worked in New York City for 10 years. She received her Master's degree in Oriental Medicine & Acupuncture in 2000.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 9:	document.getElementById('specialist_details').children[0].src="images/Specialists/sunny.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Caesar<br>Physical Therapist<br></b>(no description).";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 10:document.getElementById('specialist_details').children[0].src="images/Specialists/caesar.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Caesar Munoz<br>Physical Therapist<br></b>(no description).";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 11:document.getElementById('specialist_details').children[0].src="images/Specialists/cecille.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Cecille Mary<br>Physical Therapist<br></b>(no description).";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 12:document.getElementById('specialist_details').children[0].src="images/Specialists/mario.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Mario Aldini<br>Licenced Massage Therapist<br></b>(no description).";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 13:document.getElementById('specialist_details').children[0].src="images/Specialists/karen.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Karen Artz<br>Licenced Massage Therapist<br></b>(no description).";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 14:document.getElementById('specialist_details').children[0].src="images/Specialists/Joy.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Joy Curran<br>Physical Assistant<br></b>(no description).";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 15:document.getElementById('specialist_details').children[0].src="images/Specialists/richard.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Richard Villinoza<br>Physical Assistant<br></b>has been practicing physical therapy since 2003. In 2006 he began working on orthopedic cases with knee and shoulder as his specialty. He has taught classes to his fellow colleagues on shoulder and knee treatment protocols. He brings a great amount of expertise to his patients who respond with outstanding result in both pre- and post-surgery.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 16:document.getElementById('specialist_details').children[0].src="images/Specialists/grace.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Grace Collaro<br>Massage Therapist<br></b>has been a licensed massage therapist for 24 years. She graduated from the Swedish Institute of Health and Sciences in Manhattan and specializes in Swedish, deep tissue, sports and medical massage.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 17:document.getElementById('specialist_details').children[0].src="images/Specialists/tracy.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Dr. Tracy<br> Chiropractor<br></b>Dr. Tracy is a 1997 graduate of Life Chiropractic University in  Atlanta Georgia. In 1998, she opened her own practice in New York City and practiced there for seven years.  In 2005 Dr. Tracy she was married  and began practicing in Goshen New York.  We are now proud and honored to have her as part of our experienced team of Doctors of Chiropractic.  Dr Tracy's many years of experience provides her with a unique ability to communicate and understand her patients' concerns and address the health care condition with her caring and compassionate approach.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20, height: 270}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
		case 18:document.getElementById('specialist_details').children[0].src="images/Specialists/tracy.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<b>Marcell Zeine<br> Acupuncturist<br></b>graduated with a bachelor's degree in Chinese Medicine and a master's degree in Acupuncture at the Tri-State College. Noted for forming strong relationships with co-workers and clients, his treatment methods are designed to enhance the work of other practitioners and to help his patients with self-improvement of the mind, body and spirit.";
				 $('#specialist_details').stop().animate({opacity: 1, marginLeft: -20, height: 270}, 1500);
				 $('#doctors_specialists').stop().animate({opacity: .5, marginLeft: 0}, 1500);
				 break;
	}
}



var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

var service= {
	expand: function(obj) {
		var num=document.getElementById('addon').children;
		for (i=0;i<num.length;i++) {
			$(num[i]).animate({height: 20}, 500);
		}
		$(obj).animate({height: 290}, 1000);
		
	},
	contract: function(obj) {
		$(obj).animate({height: 30}, 1000);
		
	}
}

function change_testi (num) {
	if (BrowserDetect.browser=="Explorer" && BrowserDetect.version<=7) {
		var marg="-450";
	}
	else {
		var marg="-20"
	}

	switch (num) {
		case 0:	$('#specialist_details').animate({opacity: 0, marginLeft: -340}, 1500);
				$('#doctors_specialists').animate({opacity: 1, marginLeft: 0}, 1500);
				break;
		case 1:	document.getElementById('specialist_details').children[0].src="images/testimonies/john.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>John Novak</b> <br>\"I had knee and hip replacement surgery with chronic low back pain. I could no longer do daily activity, not even my favorite game golf. The doctors at Dolson Medical Plaza treated me like family, and got rid of my pain in no time\"";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 break;
		case 2:	document.getElementById('specialist_details').children[0].src="images/testimonies/kelly.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Kelly Price</b><br> \"My neck and shoulder pain was so bad that I couldn't drive, sleep or even sit at the computer. It felt like it was radiating to other parts of my body. Thanks to Dolson Medical Plaza I feel so much better, I can move my neck from left to right and I can work with ease.\"";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				
				 break;
		case 3:	document.getElementById('specialist_details').children[0].src="images/testimonies/gerald.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Gerald Lewis<br></b> My shoulder, back, and neck were in excruciating pain. I couldn't even drive. I've seen other doctors and even underwent a surgery. Dolson Medical Plaza has made my pain managable, I can now get back to work.";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				
				 break;
		case 4:	document.getElementById('specialist_details').children[0].src="images/testimonies/perez.nilda.JPG";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Nilda Perez</b><br> \"I fell down the stairs several years ago and was unable to stand, sit or walk. I went to Dolson Medical Plaza where they really knew what to do to help me.\"";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				
				 break;
		case 5:	document.getElementById('specialist_details').children[0].src="images/testimonies/oscar.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Oscar Rosado<br></b> I had a bad traffic accident with a UPS truck. It left my rotator cuff and shoulder in agony. I'd been out of work for 24 months and I couldn't even pick up my grandson. I recieved physical therapy at Dolson Medical Plaza, and now I feel excellent. I can enjoy time with my family again. ";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 6:	document.getElementById('specialist_details').children[0].src="images/testimonies/chris.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Chris Torres<br></b> I had severe low back pain. It had bothered me on and off for years but was getting worse. I had a few injuries in the United States Air Force, which made it difficult for me to bend over or run. Now, I am back to my old self again! I am playing football for the Hudson Valley Cowboys. I can now bend and can run faster than ever with no pains or aches. The treatment was spectacular. ";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 7:	document.getElementById('specialist_details').children[0].src="images/testimonies/dixie.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Dixie Campbell<br></b> After the car accident, I was unable to bend or lift things because of the terrible neck, back and shoulder pain that I felt. I went to Dolson Avenue Medical and I was surprised at how friendly and caring the staff was! They treated me like family. ";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 8:	document.getElementById('specialist_details').children[0].src="images/testimonies/kathryn.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Kathryn Grieco<br></b> I started having constant neck and back pain after playing sports. The pain was so annoying, I couldn't sit down and concentrate in class. After getting therapy at Dolson Avenue Medical, my back is now much better and I went on to win the Lacrosse trophy. ";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 9:	document.getElementById('specialist_details').children[0].src="images/testimonies/valentino.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Valentino Castro<br></b>I had a very bad fall. Since then I could not walk without my cane, stand up or turn over in bed. Doctors told me there was nothing they could do. I heard about Dolson Avenue from my church and decided to go there for therapy. Now, I don't need my walker anymore. I am able to live my life again!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 10:	document.getElementById('specialist_details').children[0].src="images/testimonies/deborah.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Deborah Accomando<br></b>My life has been very difficult after the stroke, but the therapists at Dolson Medical Plaza worked wonders for me! Now I can move, walk and drive again!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 11:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_1.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Karanjit Kaur<br></b> My back pain was becoming worse that I could no longer do normal household activities or pick up my daughter. My doctor referred me to Dolson Avenue Medical for therapy. It was over a year that I was in pain. Now, I'm so happy to finally be out of pain. ";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 12:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_2.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Janet Kass<br></b>I was unable to stand, walk or flex my foot because the pain in my upper back, shoulders and Achilles tendon was very sharp. Walking without limping is now possible thanks to Dolson Avenue Medical. I am so grateful for the professional care I received. I have recovered almost one hundred percent.";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 13:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_3.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Anna Johnson<br></b>My knee pain was unbearable. I was unable to walk to the kitchen because of the severe pain and I couldn't resume my daily activities. My knees feel stronger than ever thanks to the doctors and physical therapists from Dolson Avenue Medical. Now I can return to my daily activities and to my old self. Today I walked two miles!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 14:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_4.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Stephanie Dobson<br></b>I worked as a certified nursing assistant in rehab so I do a lot of lifting with patients. I started having headaches and had difficulty bending. I was receiving medication for my headache until I came to Dolson Medical Avenue where they told me that my back injury was the cause of my problems. I received treatment and now I feel so good!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 15:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_5.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Emely Diaz<br></b>I had a constant, burning pain on my lower back from lifting heavy articles at work. When I got to Dolson Avenue Medical, I was unable to move; the pain was unbearable. I am feeling better everyday and the pain has decreased. Now I can walk, sit, and move around willingly. In a matter of a week my condition improved dramatically. ";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 16:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_6.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Travis Cruz<br></b>Constant back pain made it difficult for me to concentrate. It is so annoying how the pain would get in the way of everyday activities. I went to Dolson Avenue Medical to get therapy. Now I am pain free and back to my active self! I will be playing basketball for the OCCC team this year, which I couldn't do before.";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 17:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_7.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Jenalynn Crawford<br></b>After a skiing accident, I felt severe pain in my head. I could not go outside the house, except to spend time in the hospital. After being treated at Dolson Avenue Medical, I have more enery to do the things I like!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 18:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_8.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Scott Coultas<br></b>I was lifting and moving furniture when a couch fell on me. I was out of work for several months and I had a hard time bending, sitting, standing and lying down. I went to Dolson Avenue Medical to get therapy. The doctors made sure I understood my condition and were very attentive during the therapy sessions. Thanks to them I am getting better each day!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 19:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_9.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Rebecca Cooper<br></b>I started having terrible headaches and wrist pain as I was doing my homework. My grandmother referred me to Dolson Avenue Medical. I am very pleased with the improvement that I got. Now I can do my homework without complaining of any pain.";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 20:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_10.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Tolentino Barayuga<br></b>I used to go running to keep myself in shape, but my knees got weaker over the years. After physical therapy treatments at Dolson Avenue Medical, I am now able to climb up and down stairs. I am also able to walk without any pain. I am so thankful for this wonderful, caring group.";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 21:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_11.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Clarissa Baquero<br></b>The pain in my arm was so terrible; I couldn't dress up by myself. I was referred by my orthopedist to Dolson Avenue Medical. After physical therapy treatments, I am now able to raise my arm up and carry things without feeling any pain. What a relief!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 22:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_12.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Lisa Baisley<br></b>I was riding my bicycle when a tree fell on my head. I had severe pain in my neck. I couldn't lie down on my back or turn my head. After being treated at Dolson Avenue Medical, I can now do these things again!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 23:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_13.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 24:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_14.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Raj Atodaria<br></b>About ten years ago I fell doing chores around the house, and ever since then the pain has been gradually worsening over the years. I have been unable to walk, bend, or lift things. Severe, sharp pain all over my back, hips and leg was unbearable. In only 3 visits, I made huge progress.  The staff of Dolson Avenue Medical has given me great care; I feel such a relief!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 25:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_15.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Ruben Abrahante<br></b>A gradual onset of a severe shooting neck and back pain made me seek medical help. I was not able to work for six months due to the pain. Since coming to Dolson Medical Plaza, now I can touch my toes and turn my head from left to right! I am back to work now and feeling very good!!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
		case 26:	document.getElementById('specialist_details').children[0].src="images/testimonies/testi_16.jpg";
				document.getElementById('specialist_details').children[2].innerHTML="<br><b>Sonia Anderson<br></b>For months I couldn't raise my legs to walk.  I have seen two doctors already but didn't notice any improvement.I did not think chiropractic adjustments would help my legs, but I went to Dolson Avenue Medical, anyway. Now, I feel so good because I can use the stairs without the pain!";
				 $('#specialist_details').animate({opacity: 1, marginLeft: marg}, 1500);
				 
				 break;
	}
}
var capArray=new Array("\"The greatest of follies is to sacrifice health for any other kind of happiness.\"<p align='right'> - Arthur Schopenhauer</p>","\"Life is not measured by the number of breaths we take, but by the moments that take our breath away.\"<p align='right'> -  Boyd Palmer</p> ", "\"All growth depends upon activity. There is no development physically or intellectually without effort, and effort means work. \"<p align='right'> - Calvin Coolidge</p>", "\"There's a lot of people in this world who spend so much time watching their health that they haven't the time to enjoy it. \"<p align='right'> - Josh Billings</p>", "Dolson Medical Plaza<br>\"Keeping you healthy, happy, and active.\" <br> Call us today: <br> 845.342.0000" );

var capNum=0;
var captions= {
	change: function(num) {
		var obj=document.getElementById('slideshow_caps');
		if (capNum==1) {
			var old=obj.children[1]
			var oldWords=old.children[0]
			$(old).animate({opacity: 0, marginLeft: -200}, 1500);
			$(oldWords).animate({opacity: 0, marginLeft: 300}, 1500);
			var obj=obj.children[0]
			var words=obj.children[0];
			words.innerHTML=capArray[num];
			$(obj).animate({opacity: 1, marginLeft: 0}, 1500);
			$(words).animate({opacity: 1, marginLeft: 0}, 1500);
			capNum=0;
			captions.move(num);
			
			
		}
		else if (capNum==0) {
			var old=obj.children[0]
			var oldWords=old.children[0]
			$(old).animate({opacity: 0, marginLeft: -200}, 1500);
			$(oldWords).animate({opacity: 0, marginLeft: 300}, 1500);
			var obj=obj.children[1]
			var words=obj.children[0];
			words.innerHTML=capArray[num];
			$(obj).animate({opacity: 1, marginLeft: 0}, 1500);
			$(words).animate({opacity: 1, marginLeft: 0}, 1500);
			capNum=1
			captions.move(num);
			
			
		}
		
			
	}, 
	move: function (num) {
		
			switch (pos[num]) {
				case 1: $('#slideshow_caps').animate({marginLeft: 460, marginTop: 270}, 1500);
				break;
				case 2: $('#slideshow_caps').animate({marginLeft: 460, marginTop: 20}, 1500);
				break;
				case 3: $('#slideshow_caps').animate({marginLeft: 30, marginTop: 20}, 1500);
				break;
				case 4: $('#slideshow_caps').animate({marginLeft: 30, marginTop: 270}, 1500);
				break;
				
			}
		
	}
	
	
}



var nav = {
	show: function(obj) {
		$(obj).animate({opacity: 1}, 300);
	},
	hide: function(obj) {
		$(obj).animate({opacity: .5}, 300);
	}
}
	
function open_info (num) {
	if (BrowserDetect.browser="Explorer" && BrowserDetect.version<=7) {
		var obj=$('.info');
	}
	else {
		var obj=document.getElementsByClassName('info')
	}
	
	
	switch (num) {
	case 0:	$(obj[num]).animate({height: 400}, 800);
	$(obj[1]).animate({height: 0}, 800);
	break;
	case 1:	$(obj[num]).animate({height: 600}, 800);
	$(obj[0]).animate({height: 0}, 800);
	break;
	}
}


var testi_box = {
	spread: function(num) {
		var main_obj=document.getElementById('testis');
		$('.bg').stop().animate({opacity:1},800);
		$(main_obj).stop().animate({height: 420}, 800);
		var objs=main_obj.children;
					$(objs[0]).stop().animate({marginTop: -30, marginLeft: -100, height: 220}, 300);
					$(objs[1]).stop().animate({marginTop: -30, marginLeft:300, height: 220}, 300);
					$(objs[2]).stop().animate({marginTop: 240, marginLeft:-100, height: 220}, 300);
					$(objs[3]).stop().animate({marginTop: 240, marginLeft:300, height: 220}, 300);
					
		
	},
	contract: function(num) {
		var main_obj=document.getElementById('testis');
		$(main_obj).stop().animate({height: 210}, 800);
		$('.bg').stop().animate({opacity:0},800);
		var objs=main_obj.children;
					$(objs[0]).stop().animate({marginTop: 10, marginLeft: -5, height: 110}, 300);
					$(objs[1]).stop().animate({marginTop: 10, marginLeft:250, height: 110}, 300);
					$(objs[2]).stop().animate({marginTop: 100, marginLeft:-5, height: 110}, 300);
					$(objs[3]).stop().animate({marginTop: 100, marginLeft:250, height: 110}, 300);
					
		
	}
	
	
}
