/* ----------------------------------------------------------
	title		  : MTZBC Framework
	created		  : 5/27/09
	last updated  : 6/9/09
---------------------------------------------------------- */
jQuery.noConflict();     
jQuery(document).ready(function($){


/* Image Rotator */
function buildPager(ind, slide) {
	ind++;
	var tabTitle = $('.container', slide).text();
	
	if (tabTitle.replace(/ /g,'') == '') { tabTitle = 'slide ' + ind }
	
	return '<li class="tab-'+ ind +'"><a href="#">' + tabTitle + '</a></li>';
}


function rotateMagic() {
	if ( $('#feature').length ) {
	
	$('#feature-rotator').append('<ul id="feature-controls"></ul>');
	
		$('#feature-rotator #feature-slides').cycle({
		fx: 'fade',
		speed: 'slow',
		timeout: 0,
		pager: '#feature-controls',
		pagerAnchorBuilder: buildPager,
		startingSlide: 3
		});
	
	}

}


if ( $('#adminbar #toolbar').length ) {
	
	//if admin
	$('#feature #feature-rotator .regionBoundary .contentRegion .regionName').remove();
	rotateMagic();

	
} else {

	rotateMagic();
	
}



});//end doc ready