jQuery(function($){
	var $home = "/breast-care-info.htm";
	if (location.pathname == $home)
		{
			$('#mainNav a[href="' + $home + '"]').addClass('current');
		}
	$("#mainNav a").not(".current, li ul a, #logoContainer a").hover(
		function(e){
			$(this).stop().animate({backgroundColor: "#D1C6DD"}, 250);
		},function(e){
			$(this).stop().animate({backgroundColor: "#FFF"}, 250);
		});
	$("#mainNav a").not(".current").hover(
	function(e){
		$(this).css({"backgroundPosition": "15px center"})
	},function(e){
		$(this).css({"backgroundPosition" : "-7px center"});
	});//end hover
	
	//Start Video Player setup
    var targetID = 1;
    $(".player, p:has(span.player)").each(function(){
      $(this).attr("id", "target" + targetID);
      $(this).text("");
      $(this).nextUntil(".player", "p, ol, ul").find("a").has(".video").attr("rel","target" + targetID);
      $(this).wrap("<div class='vp' id='player-target" + targetID + "'/>");
      targetID ++;
    });
    $("a:not(a:has('.video'))").click(function(e){
      if( $(".playing").length ){
        $("#player-" + target).html("");
				$(".playing").remove();
      }
    });
    var target;
    $("a").has(".video").click(function(e){
      e.preventDefault();
      $(".playing").remove();
      $("#player-" + target).html("");
      $(this).append("<span class='playing'> &lArr; Now Playing</span>");
      var path =  $(this).attr("href");
      target = $(this).attr("rel");
      flashIt(path, target);
    });
		//end video player setup
		$(".download a, a:has(.download)").attr('href', function(){
	  return this.href + "?attachment=yes";
	  });
	
});//end jQuery


// function to load the video player using swfobject 2.2
function flashIt(_path, _target){
  $("#player-" + _target).html("<p id='"+_target+"' class='player'>New Video Area</p>");//UA-12161257-5
  var flashvars = {};
  flashvars.file = _path;
  flashvars.autostart = true;
  flashvars.plugins = "gapro-1";
  flashvars['gapro.accountid'] = "UA-12161257-7";
  flashvars['gapro.trackstarts'] = "true";
  flashvars['gapro.trackpercentage'] = "true";
  flashvars['gapro.tracktime'] = "true";
  var params = {};
  params.menu = "false";
  params.bgcolor = "#000000";
  params.allowscriptaccess = "always";
  params.allowfullscreen = true;
  var attributes = {};
  attributes.id = "flash content";
  attributes.name = "flash content";
  swfobject.embedSWF("/Commonscripts/videoPlayer/player-licensed.swf", _target, 427, 320, "9.0.0", "false", flashvars, params, attributes);
}