$(function() {
	$("ul.sf-menu").superfish();
	$('#home-slideshow').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: 5000,
		pager: '#home-slideshow-nav',
		pagerAnchorBuilder: function(idx, slide) {
			return '#home-slideshow-nav li:eq(' + (idx) + ') a';
		}
	});
	$('#hi-level-slideshow').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: 5000,
		pager: '#hi-level-slideshow-nav',
		pagerAnchorBuilder: function(idx, slide) {
			return '#hi-level-slideshow-nav li:eq(' + (idx) + ') a';
		}
	});

	var tabContainers = $('div.tabs div.tabContent');
	tabContainers.hide().filter(':first').show();

	$('div.tabs ul.tabNavigation a').click(function() {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$(this.hash + ' .carousel').jcarousel({ visible: 5 }); //AT
		$('div.tabs ul.tabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();

	$('.overlayOpen').click(function(e) {
		e.stop;
		$('.overlay').css('opacity', '.65');
		$('.overlay').css('filter', 'alpha(opacity=65)');
		$('.overlay').fadeIn();
		$('#searchbox').fadeIn();
	});

	$('.overlayClose').click(function(e) {
		$('.overlay').fadeOut();
		$('#searchbox').fadeOut();
	});

	$('.ccoverlayOpen').click(function(e) {
		e.stop;
		$('.overlay').css('opacity', '.65');
		$('.overlay').css('filter', 'alpha(opacity=65)');
		$('.overlay').fadeIn();
		$('#ccoverlay').fadeIn();
	});

	$('.ccoverlayClose').click(function(e) {
		$('.overlay').fadeOut();
		$('#ccoverlay').fadeOut();
	});

	$('.ssoverlayOpen').click(function(e) {
		e.stop;
		$('.overlay').css('opacity', '.65');
		$('.overlay').css('filter', 'alpha(opacity=65)');
		$('.overlay').fadeIn();
		$('#ssoverlay').fadeIn();
	});

	$('.ssoverlayClose').click(function(e) {
		$('.overlay').fadeOut();
		$('#ssoverlay').fadeOut();
	});

	$('input#search-text').focus(function() { if ($(this).val() == 'Enter your search here') $(this).val(''); })
	$('input#search-text').blur(function() { if ($(this).val() == '') $(this).val('Enter your search here'); })

//	jQuery('.carousel').jcarousel({ visible: 5, scroll: 5 });
});

