//<![CDATA[
function setPage() {
//set main content blocks height
	$("#services li").height("auto");
	equalHeight($("#services li"));

	//set rotating feature height
	$(".feature-box, #rotator").height("auto");
	equalHeight($(".feature-box"));	
	$("#rotator").height($(".feature-box").height());
}

window.onload = setPage; //For Safari

$(document).ready(function() { 
	//Set slideshow defaults	
	$(".feature-box").height("auto").css({'display':'none','background':'#fff'});
	$(".feature-box:first-child, #rotator-nav").css('display','block');
	$(".simg").append("<span class='cnr tl'/><span class='cnr tr'/>");
	
	attachEventListener(window, "resize", setPage, false);
	setPage();
	
	//Start slideshow
	var navlabel = 0;
			
		if ( $('#rotator').length > 0 ) {
		
			$('#rotator').cycle({
			timeout:8500,
			speed:'fast',
			pager:'#rotator-nav',
			
			pagerAnchorBuilder: function(idx, slide) { 

			navlabel++;
				return '<span><a href="#">' + navlabel + '</a></span>';
				}
			}
			);
			$('#rotator-nav').append("<span><a id='pbtn' class='pause'>&nbsp;</a></span>");

			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;
				}
			});
		}
	
		}); 
	//End slideshow
//]]>