$(document).ready(function(){
	/* buttons */
	$(".btn-active").mousedown(function(){
		$(this).css("background-position","0 -32px");
	}).mouseup(function(){
		$(this).css("background-position","0 0");
	});
/*	this takes the text of the question and the answer in the text box
	and turns them into a string with "@mint #mintqotd http://bit.ly/2HVLzZ" on the end, which 
	populates the "status" box on Twitter */
	$("#twitter-btn").click(function(){
		//var sendStatus = $("#actual-question").text();
	  var sendStatus = $("#actual-answer").val();
		sendStatus = sendStatus + " @mint #mintqotd http://bit.ly/2HVLzZ";
		$("#status").val(sendStatus);
	});
	$("#main-tabs a").click(function(){
		var whichTab = $(this).attr("href");
		$("#main-tabs li").removeClass("current");
		$(".tab-content").removeClass("active");
		$(this).parents("li").addClass("current");
		$(whichTab).addClass("active");
		return false;
	});
    
	/* adding and removing categories from the category stream */
	$("#categories-list li").click(function(){
        $("#categories-list li").removeClass("current");
		if($(this).hasClass("current")){
			$(this).removeClass("current");
		} else {
			$(this).addClass("current");
		}
		var currents = $("#categories-list li.current");
		var showThis = "";
		for(i = 0; i < currents.length; i++){
			showThis = showThis + $(currents[i]).text() + ", ";
		}
		var showThis = showThis.substring(0, showThis.length-2);
		$(".currently-showing span").text(showThis);
		return false;
	});
});

function equalHeight(group) {
    tallest = 0;      
    group.each(function() {
        thisHeight = jQuery(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}

