function toggleFiltersDisplay(bShow) {
	if(bShow) {
		document.getElementById("filters_div").style.visibility = "visible";
	}
	else {
		document.getElementById("filters_div").style.visibility = "hidden";
	}
};

function submitSearch() {
	document.getElementById("offset").value = 0;
	document.forms['searchform'].submit();
};

function searchResults(iOffset) {
	document.getElementById("offset").value = iOffset;
	document.forms['searchform'].submit();
};

function validateRating() {
	var allratings = document.getElementById('ratings').getElementsByTagName('input');
	for(var i = 0; i < allratings.length; i++) {
		if(allratings[i].checked == true) {
			return true;
		}
	}
	return false;
};

var commentsLength = 255;
function checkComments(evt, obj) {
	if(obj.value.length < commentsLength) {
		return true;
	}
	else if(evt.keyCode >= 48 && evt.keyCode <= 90) {
		return false;
	}
	showCommentsChars(obj);
};
function validateComments(obj) {
	if(obj.value.length > commentsLength) {
		obj.value = obj.value.substr(0, commentsLength);
	}
	showCommentsChars(obj);
};
function showCommentsChars(obj) {
	document.getElementById("CommentsCount").innerHTML = commentsLength - obj.value.length;
};