function changeFlashMovie(movie_name) {
	var so = new SWFObject("images/swf/testimonial/tm-madison.swf", "flash", "440", "330", "7", "#336699");
	so.addParam("quality", "high");
	so.addParam("FlashVars", "videourl=" + movie_name);
	so.addParam("wmode", "transparent");
	so.addParam("salign", "t");
	so.write("testimonial_movie");
}

function showTestimonial(tm_id) {

	// Let's start with the vars
	var tm_title_img   		= document.getElementById("testimonial_title");
	var tm_description 		= document.getElementById("testimonial_description");
	var tm_name        		= document.getElementById("testimonial_name");
	var tm_job         		= document.getElementById("testimonial_job");
	var tm_movie       		= document.getElementById("testimonial_movie");
	var tm_share		 	= document.getElementById("tshare");
	var tm_url		 	    = document.getElementById("url");	

	// Reset the opacity to 60% in all images
	for(i = 1; i <= 9; i++) {
		document.getElementById("tm_image_0" + i).className = "opacityOn";
	}
	for(j = 10; j <= 18; j++) {
		document.getElementById("tm_image_" + j).className = "opacityOn";
	}
	

	// Fix the opacity 100% on the selected image
	document.getElementById("tm_image_" + tm_id).className = "fixedOpacityOff";

	// Now we gonna do the "Ajax" part
	switch (tm_id) {
		/*
		 * Usage:
		 *
		 	case tm_id: // change to 'image number' (with the '')
		 		tm_title_img.src = ""; // the title image
				tm_description.innerHTML = ""; // a short description of the testimonial
				changeFlashMovie("images/swf/testimonial/%PUT THE FLASH NAME HERE%.swf"); // change the flash movie (remove the %%)
			break;
		 *
		 * To add a new movie,  just copy and past the code above.
		 *
		 */
	
		
		case '01':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-George.gif" alt="The Animas organization really cares about the product and the people that it&acute;s helping, and that makes a world of difference." title="The Animas organization really cares about the product and the people that it&acute;s helping, and that makes a world of difference." width="355" height="100" id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>George Canyon</h4>";
			tm_description.innerHTML = "George tells us what a difference the Animas<sup>&reg;</sup> insulin pump has made to help him manage his diabetes better while on the road as a musician.<br/><br/><span class='abb10'>To find out more about George,<br />please visit <a href=\"javascript:Print('http://www.GeorgeCanyon.com');\" title='George Canyon Official Website'>www.GeorgeCanyon.com</a>.</span>";
			tm_job.innerHTML         = "Canadian Country Music Award Winner<br />Canadian Male Artist of the Year 2006<br />Two-time Juno Award Winner<br />Diabetes for 23 years";			
			changeFlashMovie("flv/George_Canyon_v1.flv");
		break;
		
		case '02':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Hannah.gif" alt="I knew the Animas&reg; pump was great for me because it&rsquo;s waterproof." title="I knew the Animas&reg; pump was great for me because it&rsquo;s waterproof." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Hannah</h4>";
			tm_description.innerHTML = "";
			tm_job.innerHTML         = "Competitive Alpine ski racer <br/>Competitive flat water sprint kayaker <br />Age 14 <br />Diabetes for 2 years";
			changeFlashMovie("flv/hannah_090702.flv");
		break;
		
		case '03':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Mike.gif" alt="I&rsquo;m really glad I chose Animas&reg; because I got more than just a pump." title="I&rsquo;m really glad I chose Animas&reg; because I got more than just a pump." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Mike</h4>";
			tm_description.innerHTML = "";
			tm_job.innerHTML         = "Member of the National Adapted Snowboarding Team <br/>Below the knee amputee (motorcycle accident) <br />Age 21 <br />Diabetes for 2 years";
			changeFlashMovie("flv/mike_fisher_short_090702.flv");
		break;
		
    	case '04':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Maryanne.gif" alt="I live my life with diabetes pretty well, even better since I got my pump... Now I can always give my 100%." title="I live my life with diabetes pretty well, even better since I got my pump... Now I can always give my 100%." id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>Maryanne</h4>";
			tm_description.innerHTML = "";
			tm_job.innerHTML         = "Figure skater<br />Age 10<br />Diabetes for 5 years";			
			changeFlashMovie("flv/Maryanne.flv");
		break;
		
		case '05':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Leanne.gif" alt="Depending on what I&eacute;m wearing, I can tuck it into a pocket...I hardly even know that it&eacute;s there." title="Depending on what I&eacute;m wearing, I can tuck it into a pocket...I hardly even know that it&eacute;s there." id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>Leanne</h4>";
			tm_description.innerHTML = "";
			tm_job.innerHTML         = "Outrigger canoeist<br />Diabetes for 2 years ";	
			changeFlashMovie("flv/Leanne.flv");
		break;
		
		case '06':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Chase.gif" alt="If I had a chance to talk to other kids just diagnosed with Type I diabetes, I&eacute;d tell them that there&eacute;s nothing they can&eacute;t do if they put their mind to it." title="If I had a chance to talk to other kids just diagnosed with Type I diabetes, I&eacute;d tell them that there&eacute;s nothing they can&eacute;t do if they put their mind to it." id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>Chase &amp; Dad</h4>";
		    tm_description.innerHTML = "";
			tm_job.innerHTML         = "Go-kart racer<br />Age 12<br />Diabetes for 2 years  ";	
			changeFlashMovie("flv/Chase.flv");
		break;
		
		case '07':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Lynda.gif" alt="Depending on what I&eacute;m wearing, I can tuck it into a pocket... I hardly even know that it&eacute;s there." title="Depending on what I&eacute;m wearing, I can tuck it into a pocket... I hardly even know that it&eacute;s there." id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>Lynda</h4>";
			tm_description.innerHTML = "";
			tm_job.innerHTML         = "Lawyer &amp; horseback riding enthusiast<br />Diabetes for 35 years ";	
			changeFlashMovie("flv/Lynda.flv");
		break;
		
		case '08':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Adam.gif" alt="We found the (Animas <sup>&reg</sup>) support staff to be absolutely first class." title="We found the (Animas <sup>&reg</sup>) support staff to be absolutely first class." id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>Adam &amp; Dad</h4>";
			tm_description.innerHTML = "";
			tm_job.innerHTML         = "Baseball enthusiast<br />Age 9<br />Diabetes for 3 years ";	
			changeFlashMovie("flv/Adam.flv");
		break;								
		
		case '09':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Nicole.gif" alt="All I can think is, Why did I wait so long?" title="All I can think is, Why did I wait so long?" width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Nicole</h4>";
			tm_description.innerHTML = "Nicole tells us about her experience moving from multiple daily injections to the Animas<sup>&reg;</sup> insulin pump.";
			tm_job.innerHTML         = "LifeScan Canada employee&mdash;Product Manager<br />New to pump therapy<br />Diabetes for 27 years";
			changeFlashMovie("flv/nicole-1.flv");
		break;
		
		case '10':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Pearlsa.gif" alt="For me, a little bit of insulin goes a long way." title="For me, a little bit of insulin goes a long way." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Pearlsa</h4>";
			tm_description.innerHTML = "Pearlsa tells us how the .025 basal rate makes a big difference for her diabetes control, and how the people at Animas are part of her diabetes team.";
			tm_job.innerHTML         = "E-commerce Systems Analyst<br />Highly insulin sensitive<br />Diabetes for 9&amp;1/2 years";		
			changeFlashMovie("flv/pearlsa.flv");
		break;
		
		case '11':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-NicoleAndCorrina.gif" alt="Animas is always there to help us when we really need it." title="Animas is always there to help us when we really need it." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Nicole &amp; Corrina</h4>";
			tm_description.innerHTML = "Nicole and Corrina share a traumatic experience and how Animas responded to take care of them.";
			tm_job.innerHTML         = "Daughter and Mom<br />Diabetes for 5 years";		
			changeFlashMovie("flv/nicole-2.flv");
		break;
		
		case '12':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Brydon.gif" alt="I can pretty much play the game of my life and not even have to worry about getting low." title="I can pretty much play the game of my life and not even have to worry about getting low." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Brydon</h4>";
			tm_description.innerHTML = "Brydon tells us how being on a pump gives him the freedom and flexibility to perform at his best on the basketball court.";
			tm_job.innerHTML         = "High school student<br />Basketball enthusiast<br />Diabetes for 6 years";		
			changeFlashMovie("flv/brydon.flv");
		break;
		
		case '13':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Madison.gif" alt="I can just take my pump off of my waist and then click a few buttons and I&rsquo;m done. I can go skating again." title="I can just take my pump off of my waist and then click a few buttons and I&rsquo;m done. I can go skating again." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Madison</h4>";
			tm_description.innerHTML = "<p>Madison tells us how the Animas<sup>&reg;</sup> pump lets her enjoy being a kid without the added burden of multiple injections a day.</p>";
			tm_job.innerHTML         = "11-years old<br />Future artist<br />Diabetes for 6 years";		
			changeFlashMovie("flv/MADISON.flv");
		break;
		
		case '14':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Brian.gif" alt="I had great control before being on the pump, but I don&rsquo;t think I had much of a life." title="I had great control before being on the pump, but I don&rsquo;t think I had much of a life." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML        = "<h4>Brian</h4>";
			tm_description.innerHTML = " Brian tells us how the Animas<sup>&reg;</sup> pump helped him pursue his dreams of running in the Boston Marathon &mdash; five times!";
			tm_job.innerHTML         = "Animas US Employee&mdash;Pump Support<br />Marathon runner<br />Diabetes for 26 years";			
			changeFlashMovie("flv/BRIAN.flv");
		break;
		
		case '15':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-DrJuanFrias01.gif" alt="The pump actually acts more like a normal pancreas than do multiple daily injections." title="The pump actually acts more like a normal pancreas than do multiple daily injections." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Dr. Juan Frias</h4>";
			tm_description.innerHTML = "Dr. Frias tells us about the health and lifestyle benefits of pump therapy with the Animas<sup>&reg;</sup> 2020 pump versus multiple daily injections.";
			tm_job.innerHTML         = "Medical Director, Animas Corporation<br />Endocrinologist";		
			changeFlashMovie("flv/DR_FRIAS.flv");
		break;
		
		case '16':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Roxanne.gif" alt="I am wearing my pump right now.  I&rsquo;m always wearing my pump. I&rsquo;d never give my pump up, not for a million dollars." title="I am wearing my pump right now.  I&rsquo;m always wearing my pump. I&rsquo;d never give my pump up, not for a million dollars." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Roxanne</h4>";
			tm_description.innerHTML = "Roxanne tells us about the unique features of the Animas<sup>&reg;</sup> 2020 pump and the difference it can make in your life. ";
			tm_job.innerHTML         = "Certified Diabetes Educator<br />Diabetes for 48 years";			
			changeFlashMovie("flv/ROXANNE.flv");
		break;
		
		case '17':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Rick.gif" alt="I don&rsquo;t want someone to control how I deal with my day-to-day activities... I want to control that myself and I think the Animas 2020&#8482; does that." title="I don&rsquo;t want someone to control how I deal with my day-to-day activities... I want to control that myself and I think the Animas 2020&#8482; does that." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Rick</h4>";
			tm_description.innerHTML = "Rick tells us how the Animas team can help you understand how to perform at your desired activity level while maintaining blood glucose control.";
			tm_job.innerHTML         = "Animas US Employee&mdash;Performance Specialist,<br />Sports and Fitness<br />Diabetes for 11 years";		
			changeFlashMovie("flv/RICK_PHILBIN.flv");
		break;
		
		case '18':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Elizabeth.gif" alt="Pump support is available at all times throughout the day and night so for me that means that Animas really must care." title="Pump support is available at all times throughout the day and night so for me that means that Animas really must care." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Elizabeth</h4>";
			tm_description.innerHTML = "Elizabeth tells us how the Animas Pump Support professionals are a dedicated team, devoted to making sure you have the support you need to get the most out of pump therapy.";
			tm_job.innerHTML         = "College student<br />Diabetes for 16 years";		
			changeFlashMovie("flv/ELIZABETH.flv");
		break;
/*		
		case '19':
			tm_title_img.innerHTML       = '<img src="images/title/tm-title-Carl.gif" alt="I wouldn&rsquo;t trade the pump in for anything. Getting up the courage to stick that needle in me five or six times a day... that&rsquo;s just not going to happen." title="I wouldn&rsquo;t trade the pump in for anything. Getting up the courage to stick that needle in me five or six times a day... that&rsquo;s just not going to happen." width="355" height="140" id="testimonial_title_image" />';
			tm_name.innerHTML = "<h4>Carl</h4>";
			tm_description.innerHTML = "Carl tells us how the pump has helped him get his blood sugar in control without multiple injections a day.";
			tm_job.innerHTML         = "Fiber-optic specialist<br />Needle-phobic<br />Diabetes for 12 years";
			changeFlashMovie("flv/CARL.flv");
		break;
*/		

	}
}

function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i = 0; i < vars.length; i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
		}
	} 
	//alert("Var: " + variable + " not found!");
}

function showMyVideo(id) {
	if (id != null && id != "") {
		showTestimonial("" + id + "");
	}
	
	if (id == '01' || id == '02' || id == '03') { moveMe(0, "true"); }
	if (id == '04' || id == '05' || id == '06') { moveMe(1, "true"); }
	if (id == '07' || id == '08' || id == '09') { moveMe(2, "true"); }
	if (id == '10' || id == '11' || id == '12') { moveMe(3, "true"); }
	if (id == '13' || id == '14' || id == '15') { moveMe(4, "true"); }
	if (id == '16' || id == '17' || id == '18') { moveMe(5, "true"); }
}
