
function showSearchForm() {
	if(document.getElementById('searchForm').style.display == "none") {
		$("#searchForm").slideDown("slow");
	}
	else {
		$("#searchForm").slideUp("slow");
	}
}

function showAnswerForm() {
	if(document.getElementById('form_jb').style.display == "none") {
		$("#form_jb").slideDown("slow");
	}
	else {
		$("#form_jb").slideUp("slow");
	}
}

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(limit - textlength);
		return true;
	}
}

