	$(function() {
		// Uncomment to start with paused tabs
		//$("#maintabs").tabs({  fx: { opacity: 'toggle' } }).tabs('rotate',0,false).tabs('option', 'selected', sel); // load tabs without slideshow 
		//pauseSlideshow();
		
		// Uncomment to start with rotating tabs
		$("#maintabs").tabs({  fx: { opacity: 'toggle' } }).tabs('rotate',rotatespeed,true).tabs('option', 'selected', sel); // load tabs with
		$("#play").css("backgroundColor","#feac31");
		$("#pause").css("backgroundColor","#666");	
		
		$('#maintabs').show();
	});

	$(function() {
		var $tabs = $("#rtsidebar").tabs({  }).tabs;
		$('#rtsidebar').show();
	});

	var pauseSlideshow = function(){
		$('#maintabs').tabs('rotate',0,'false');
		$("#pause").css("backgroundColor","#feac31");
		$("#play").css("backgroundColor","#666");
	}
	var startSlideshow = function(){
		$('#maintabs').tabs('rotate',rotatespeed,'true');
		$("#play").css("backgroundColor","#feac31");
		$("#pause").css("backgroundColor","#666");	
	}
	
	var stopTabs = function(s) {
		pauseSlideshow();
		s.blur();
	return false;
	}
	var startTabs = function(p) {
		startSlideshow();
		p.blur();
	return false;
	}
	
	jQuery(function(){   
		jQuery.getFeed({ url: '/content/gallery.xml',
		success: function(feed) {
			var desc = '';
			var html = '';
			desc += '<div class="maindesc"><h3><a href="' + feed.link	+ '">' + feed.title + '</a>' + '</h3>' + feed.description + '</div><br />';

			for(var i = 0; i < feed.items.length && i < 12; i++) {
				html += feed.items[i].description;
			}
			
			$('#gallery2imgs').html(html);
			jQuery('#gallery2imgs').append(desc);
			}    
		});
});

$(document).ready(function() {
	$('#maintabs').bind('focus', function(){
		$('#maintabs').tabs('rotate',0,'false');
		$("#pause").css("backgroundColor","#feac31");
		$("#play").css("backgroundColor","#666");
		}); 
	})