jQuery(document).ready(function() {
	$('.js-only').addClass('show-js-content');
	//Remove a class to the container
	$(".intro-carousel-js-disabled").removeClass("intro-carousel-js-disabled");
	$('#tab1').addClass('selected');
	$('#tab1').click(function() {
		resetPrevNextButtons() // reset the disable buttons when switching tabs
		$('#tab-navigation a').removeClass('selected');
		$("#tab1").addClass("selected");
		$(".tab-panel1").css("display","block");
		$(".tab-panel2").css("display","none");
		$(".tab-panel3").css("display","none");
		return false;
	});
	$('#tab2').click(function() {
		resetPrevNextButtons() // reset the disable buttons when switching tabs
		$('#tab-navigation a').removeClass('selected');
		$("#tab2").addClass("selected");
		$(".tab-panel1").css("display","none");
		$(".tab-panel2").css("display","block");
		$(".tab-panel3").css("display","none");
		jQuery(".tab-panel2").jcarousel({
			scroll: 1,
			animation: "slow",
			initCallback: mycarousel_initCallback,
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
		return false;
	});
	$('#tab3').click(function() {
		resetPrevNextButtons() // reset the disable buttons when switching tabs
		$('#tab-navigation a').removeClass('selected');
		$("#tab3").addClass("selected");
		$(".tab-panel1").css("display","none");
		$(".tab-panel2").css("display","none");
		$(".tab-panel3").css("display","block");
		jQuery(".tab-panel3").jcarousel({
			scroll: 1,
			animation: "slow",
			initCallback: mycarousel_initCallback,
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
		return false;
	});
	$('#flash-include').flash(
		{ src: '/testbed/flash/TB_Dial D02.swf',
		  wmode: 'transparent',
		  allowScriptAccess: 'always',
		  width: 209,
		  height: 279 },
		{ version: 8 }
	);
	//$('#flash-include').flash(null, null, function(htmlOptions){
	//	alert('here');
	//});

	// Display the correct buttons in the array
	$(".jcarousel-control a.step").hide();
	$(".jcarousel-control a.step:nth-child(3n+2)").css("display", "block");

		$('#shText').click(function() {	
			var el = $("#shText");
			var state = $("#shText").attr("class");
			if (state == 'open'){
				$("#search-form-filter-content .newline-select").hide("fast");
				$("#search-form-filter-content .newline-checkbox").hide("fast");
			}
			$('#search-form-filter-content').slideToggle('slow', function() {
				//sliding
				if (state == 'closed'){
					$('#shText').removeClass('closed');
					$('#shText').addClass('open');			
					$("#search-form-filter-content .newline-select").show("fast");
					$("#search-form-filter-content .newline-checkbox").show("fast");
				}else if (state == 'open'){
					$('#shText').removeClass('open');
					$('#shText').addClass('closed');
				}
			});
	return false;	
	});
});

	function MessageFadeOutAll(){
		$("#default-banner-msg, #banner-msg2, #banner-msg3, #banner-msg4").fadeOut("slow");
		$('.shout-action1, .shout-action2, .shout-action3, .shout-action4').removeClass('shout-action-selected');
	}
	function ShowMessage1(){
		MessageFadeOutAll();
		$("#default-banner-msg").fadeIn("slow");
		$('.shout-action1').addClass('shout-action-selected');
	}
	function ShowMessage2() {
		MessageFadeOutAll();
		$("#banner-msg2").fadeIn("slow");
		$('.shout-action2').addClass('shout-action-selected');
	}
	function ShowMessage3() {
		MessageFadeOutAll();
		$("#banner-msg3").fadeIn("slow");
		$('.shout-action3').addClass('shout-action-selected');
	}
	function ShowMessage4() {
		MessageFadeOutAll();
		$("#banner-msg4").fadeIn("slow");
		$('.shout-action4').addClass('shout-action-selected');
	}

