jQuery(document).ready(function(){

	$('#HomeOpener .textRight h3:first').addClass('active');
	
	$('#HomeOpener .textRight h3').click(function () {
		$('#HomeOpener .textRight h3').removeClass('active');
	});
	
	$('#HomeOpener .textRight h3').click(function() {
		$(this).addClass('active');
	});
	
	var $Categories = $('#HomeOpener .textRight h3');
	if ($Categories.length > 0) {
		$currItem = $Categories.find('~div').hide().eq(0).show();
		$Categories.each(function(){
			$(this).click(function(){
				$clickedItem = $(this).next('div:first');
				if ($clickedItem.is(':hidden') && !$clickedItem.is(':animated')) {
					$currItem.slideUp();
					$currItem = $clickedItem.slideDown();
				}
			});
		});
	}
	
	$('#HomeOpener .imageLeft').cycle({
		fx:     'fade', 
    	speed:  'slow', 
    	timeout: 0, 
    	pager:  '.textRight', 
    	pagerAnchorBuilder: function(idx, slide) { 
    	    // return selector string for existing anchor 
    	    return '.textRight h3:eq(' + idx + ')'; 
    	} 
	});
});