$(document).ready(function() { 

	if ( $('#rotator').length > 0 ) {
	
		$('#rotator').cycle({
			timeout:5000,
			speed:'fast',
			pager:'#rotator-nav',
			pagerAnchorBuilder: function(idx, slide) { 
				var navlabel = $($(slide).html() + 'img').attr('alt');
				return '<div><a href="#"><img src="/images/transparent.gif" width="20px" height="20px" /></a></div>';
			}
		});
		
		var bplplay = true;
		$('#pbtn').click(function() {
		
			if (bplplay) {
		    	$('#rotator').cycle('pause');
				$('#pbtn').removeClass('pause').addClass('play')
				bplplay = false;
			}
			else {
				$('#rotator').cycle('resume');
				$('#pbtn').removeClass('play').addClass('pause')
				bplplay = true;
			}
		});
		 
	}

}); 