$(document).ready(function() {
    $("#things").click(function () {
 		 $("#things_panel").slideToggle("slow");
	});
	$("#things_panel").mouseleave(function(){
		 $("#things_panel").slideUp("slow");
	});
	$('#bottom').supersleight();
	
	var boxheight = ($("#content").height());
	$('#pushdown').height(boxheight-160);
	$('#main_left').height(boxheight + 35);
	
	$('#comment').keyup(function(){
		limitChars('comment', 200, 'charlimitinfo');
	});
	
	function limitChars(textid, limit, infodiv)
	{
	var text = $('#'+textid).val(); 
	var textlength = text.length;
	
	if(textlength > limit)
	{
		$('#' + infodiv).html('You cannot write more then '+limit+' characters!');
		$('#'+textid).val(text.substr(0,limit));
		return false;
		}
		else
		{
		$('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.');
		return true;
		}
	}
});