function maxLength1(o,v,m){
	if(o.value.length>m){
	  document.getElementById(v).innerHTML=
	    ((o.value=o.value.substr(0,m)).length);
    }
    else{
    document.getElementById(v).innerHTML=o.value.length;
    }
}

function show(what){
	document.getElementById(what).style.display = "block";
}

function hide(what){
	document.getElementById(what).style.display = "none";
}

function show_hide(what){
	if(document.getElementById(what).style.display == 'block')
	document.getElementById(what).style.display = 'none';
	else
	document.getElementById(what).style.display = 'block';
}

function show_comment_form(where,what,count,id){
	count++;	

		for(i=0; i<=count; i++){
			if(document.getElementById("C"+i))
				document.getElementById("C"+i).innerHTML="";
			if(document.getElementById("CS"+i))
				document.getElementById("CS"+i).innerHTML="";
		}

	document.getElementById(where+what).innerHTML= "<form action=\"\" method=\"post\">Tytuł:<br /><input type=\"text\" name=\"title\" value=\"\" /><br />Imię i nazwisko:<br /><input type=\"text\" name=\"user\" value=\"\" /><br />Treść:<br /><textarea name=\"comment\" style=\"width: 450px; height: 100px;\"></textarea><input type=\"hidden\" name=\"parent_id\" value=\""+id+"\" /><input type=\"submit\" name=\"send\" value=\"dodaj\" /></form>";

	return false;
}

function show_forum_form(where,what,count,id){
	count++;	

		for(i=0; i<=count; i++){
			if(document.getElementById("C"+i))
				document.getElementById("C"+i).innerHTML="";
			if(document.getElementById("CS"+i))
				document.getElementById("CS"+i).innerHTML="";
		}

	document.getElementById(where+what).innerHTML= "<form action=\"\" method=\"post\">Imię i nazwisko:<br /><input type=\"text\" name=\"author\" value=\"\" /><br />Treść:<br /><textarea name=\"body\" style=\"width: 450px; height: 100px;\"></textarea><input type=\"hidden\" name=\"parent_id\" value=\""+id+"\" /><input type=\"submit\" name=\"send\" value=\"dodaj\" /></form>";

	return false;
}
