 var rollAccents = function() {
	$('#f1AccentSlideInner').cycle({ 
		fx: 'fade', 
		speed: 'fast', 
		delay: 200,
		timeout: 3500,
		pause: true,			
		next: '#f1anext',
		prev: '#f1aprev'
	});
	$('#f1apause').click(function() {
		if ($(this).hasClass('f1aplay')) { //Play
			$(this).removeClass('f1aplay');
			$(this).addClass('f1apause');
			$('#f1AccentSlideInner').cycle('resume');
			return false;					
		}else { //Pause			
			$(this).removeClass('f1apause');
			$(this).addClass('f1aplay');
			$('#f1AccentSlideInner').cycle('pause');
			return false;
		} 
	 });					
  };


$(document).ready(rollAccents);

/* ------------------ On Change AJAX handler----------------- */
var onChangeAccent  = function ()
{  
	var onChangeResponseAccent = function(data) { 
		$("#f1AccentSlideInner").html(data);
		rollAccents();
	}
	
	$('select#cat_id').change(function () 
	{
		$.get("ajaxResponder.php", 
			{ 'LastAccentsBlock': 1, 'cat_id': $(this).val(), 'patternid': pattern }, onChangeResponseAccent);

	}); 
};

$(document).ready(onChangeAccent);