jQuery(
	function($) {
		var className = "play";
		var name = "http://performancebiolubes.com/media/VerneVideo/";
		var aArr = [];
        var flvName = {
            "compatibilitysafetydvdsm": "compatibilitysafetydvdfull",
            "higherflashpoint328": "higherflashpoint655",
            "hornady320": "hornady655",
            "pmx320": "pmx655",
            "safeforall328": "safeforall655",
            "tristatetoolsharpening328": "tristatetoolsharpening655",
            "hawkeyetoolanddie01328": "hawkeyetoolanddie01655"
        };
		$("#movie > ul > li > a").each(function() {
			aArr.push(this);
			
			$(this).click(function(e) {
				$.each(aArr, function(i, n) {
					$(n).parent("li").removeClass(className);					  
				});
				e.preventDefault();	
				$(this).parent("li").addClass(className);									 
				var arr = this.href.split("/");
				var href = arr.slice(-1).toString().split(".")[0];
				$("#player").attr("href", name+href+".flv").css("display", "block");	
			
				flowplayer("player", "../res/js/flowplayer-3.0.7.swf");

			});							 
		});
		playChange();
        function playChange() {
            $("#play_change").toggle(
                function(e) {
                    $.each(flvName, function(key, value) {
                       var temp = [];
                       temp.push(key);
                       $("#movie ul li a").each(function(i) {
                          $(this).attr("href", temp[i]); 
                       })
                    });
					
					$("#player").css({"width":"655px", "height":"480px"});
                    e.preventDefault();
                    $(this).children().text("For slow speed internet connections >>>");
                    $("#movie_content").attr("class", "movie_content");
                   
                },
                function(e) {
                    $.each(flvName, function(key, value) {
                       var temp = [];
                       temp.push(value);
                       $("#movie ul li a").each(function(i) {
                          $(this).attr("href", temp[i]);
                       })
                    });
					
					$("#player").css({"width":"328px", "height":"240px"});
                    e.preventDefault();
                    $(this).children().text("For high speed internet connections >>>");
                    $("#movie_content").attr("class", "movie_content_small");
                }
            );
        }
	}
);
