function getSwfByName(movieName) {
         	if (navigator.appName.indexOf("Microsoft") != -1) {
             	return window[movieName];
         	} else {
             	return document[movieName];
         	}
     	}
function switchVid(vidPath, elem)
	{
		$(".video-list > *").removeClass("v-active");
		$(elem).addClass("v-active");
	 $(".video-wrapper h3").hide()
	 $("h3#h"+elem.id).show();
		getSwfByName("vidPlayer").switchVid(vidPath);
	}

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];
		}
	  }
	}

	if (getQueryVariable("name") != null) {
		switch (getQueryVariable("name")) {
			case "serena": 
				swfobject.embedSWF("/flash/content/talk/poise_player.swf", "flashcontent", "583", "327", "9.0.0", false, { vidPath: "/flash/content/talk/video/Poise.com_Testimonial_Skinny_Jeans_ORKC_0910.f4v", imgPath: "/flash/content/talk/image/still.jpg", autoPlay: true }, { menu: "false" }, { id: "flashID", name: "vidPlayer" });				
				break;
			case "ellen": 
				swfobject.embedSWF("/flash/content/talk/poise_player.swf", "flashcontent", "583", "327", "9.0.0", false, { vidPath: "/flash/content/talk/video/Poise.com_Testimonial_Motherhood_ORKC_0909.f4v", imgPath: "/flash/content/talk/image/still.jpg", autoPlay: true }, { menu: "false" }, { id: "flashID", name: "vidPlayer" });				
				break;
			case "isabella": 
			case "isabelle": 
				swfobject.embedSWF("/flash/content/talk/poise_player.swf", "flashcontent", "583", "327", "9.0.0", false, { vidPath: "/flash/content/talk/video/Poise.com_Testimonial_Allergies_ORKC_0908.f4v", imgPath: "/flash/content/talk/image/still.jpg", autoPlay: true }, { menu: "false" }, { id: "flashID", name: "vidPlayer" });				
				break;
			case "olivia": 
				swfobject.embedSWF("/flash/content/talk/poise_player.swf", "flashcontent", "583", "327", "9.0.0", false, { vidPath: "/flash/content/talk/video/Poise.com_Testimonial_Exercise_ORKC_0906.f4v", imgPath: "/flash/content/talk/image/still.jpg", autoPlay: true }, { menu: "false" }, { id: "flashID", name: "vidPlayer" });								
				break;
			default: 
				swfobject.embedSWF("/flash/content/talk/poise_player.swf", "flashcontent", "583", "327", "9.0.0", false, { vidPath: "/flash/content/talk/video/Poise.com_Testimonial_Laughing_ORKC_0907.f4v", imgPath: "/flash/content/talk/image/still.jpg", autoPlay: true }, { menu: "false" }, { id: "flashID", name: "vidPlayer" });				
				break;


		}
	} else {
		//No preset
		swfobject.embedSWF("/flash/content/talk/poise_player.swf", "flashcontent", "583", "327", "9.0.0", false, { vidPath: "/flash/content/talk/video/Poise.com_Testimonial_Laughing_ORKC_0907.f4v", imgPath: "/flash/content/talk/image/still.jpg" }, { menu: "false" }, { id: "flashID", name: "vidPlayer", wmode: "opaque" });
	}
	
	
$(document).ready(function () {
	if (getQueryVariable("name") != null) {
	 $(".video-list > *").removeClass("v-active");
	 $("li#"+getQueryVariable("name")).addClass("v-active");
	 $(".video-wrapper h3").hide()
	 $("h3#h"+getQueryVariable("name")).show();
	}
});
