/* 
	//////////////////////////////////////////////////////
	//// JavaScript file coded by SlightyBoy (c) 2008 ////
	//////////////////////////////////////////////////////
*/

var minChar = 25;

function commentForm(){
var divdisplay = document.getElementById('addcommentform').style.display;
	
	if(divdisplay == 'block'){
		document.getElementById('addcommentform').style.display = 'none';
		document.getElementById('addanchor').innerHTML = 'Dodaj komentarz'
	}
	else{
		document.getElementById('addcommentform').style.display = 'block';
		document.getElementById('addanchor').innerHTML = 'Ukryj formularz'
	}

}

function countCharsSub(){
var chars = document.getElementById('chars25').value;
	if(chars.length < minChar){
		document.getElementById('addcommentcharcount').innerHTML = '<strong>Ilość wpisanych znaków:</strong> '+chars.length;
	}
	else{
		document.getElementById('addcommentcharcount').innerHTML = '<strong>Ilość wpisanych znaków:</strong> <span style="color:green;">'+chars.length+'</span>';
	}
}

function countChars(){
	window.setInterval("countCharsSub();", 400);
}

function validateComment(){
var inp1 = document.getElementById('chars25').value.length;
var inp2 = document.forms['comment'].elements[0].value.length;

	if( inp1 >= 25 && inp2 >= 3 ){
		return true;
	}
	else{
		alert("Nieprawidłowo wypełniony formularz!\n\n- pole 'Imię/Nick' musi zawierać co najmniej 3 znaki.\n- pole 'Komentarz' musi zawierać co najmniej 25 znaków.");
		return false;
	}

}

function validateRate(){
var inp1 = document.forms['rate'].elements[0].value;

	if( inp1 > 0 ){
		return true;
	}
	else{
		alert("Nieprawidłowo wypełniony formularz!\n\n- minimalna wartość głosu to '1'.");
		return false;
	}

}

/*/ Coded by SlightyBoy (c) 2008 /*/