// CODE FOR ROTATOR
$(function() {

    $('#headline-rotation').cycle({
		fx: 'fade',
		speed:  'slow',
		timeout: 6000,
		prev:    '#prev',
		next:    '#next',
		pager:   '#nav',
		pause: 0,
		pagerAnchorBuilder: pagerFactory
	});

	function pagerFactory(idx, slide) {        
		return '<div style="float:left;"><a href="#">'+(idx+1)+'</a></div>';
	};
	
});

// TOGGLE PAUSE AND SHOW RESUME BUTTON
$(function() {
	
	// run the code in the markup!
	$('#pausebutton_img').click(function() { 
		$('#headline-rotation').cycle('pause'); 
		document.getElementById('pausebuttontray').style.display='none';
		document.getElementById('playbuttontray').style.display='block';		
	});
	
});

// TOGGLE RESUME AND SHOW PAUSE BUTTON
$(function() {
					 
	$('#playbutton_img').click(function() { 
		$('#headline-rotation').cycle('resume',true); 
		document.getElementById('pausebuttontray').style.display='block';
		document.getElementById('playbuttontray').style.display='none';				
	});
	
});