// David Moore

// Font Replace for the content
Cufon.replace('.sbModule_qaBubbles_slideout p');

// Var to change the time it takes for the slide to take
var slideTiming = 500;

$(document).ready(function(){
		
	// Show the slideout if JS is enabled
	$(".sbModule_qaBubbles_slideout_wrapper_wrapper").show();
	
	// For when the browser is resized we 
	// need to move the slideout accordingly 
	// so it sticks to the right side of the screen
	$(window).bind("resize", sbModule_qaBubbles_slideout_windowResize);
	function sbModule_qaBubbles_slideout_windowResize(e) {
		var newWindowWidth = $(window).width();
		$(".sbModule_qaBubbles_slideout_wrapper_wrapper").css("width", newWindowWidth);
	}
	
	// SLIDEOUT When clicked
	$(".sbModule_qaBubbles_slideout").click(function(e){
		e.preventDefault();
		if ( $(this).css("width") == "32px" ) {
			$(this).stop().animate({
				width: "308px"
			}, slideTiming);
		} else {
			$(this).stop().animate({
				width: "32px"
			}, slideTiming);
		}
	});
	
	//Setup the slideout for the image on the 2009 Performance home page
	$(".performance2009_topPanel .contentItemColTwo img").click(function(e){
		e.preventDefault();
		$(".sbModule_qaBubbles_slideout").trigger("click");
	});
	
	
	
});
