function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function emoticon(text) {
	var txtarea = document.formularz6.tresc_posta;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}


check = [0];
function checkBox(id)	{
	if(check[id] != true) {
		document.getElementById('imgCheck' + id).src = "/images/true.png"; 
		document.getElementById('inputCheck' + id).value = "true"; 
		check[id] = true; 
	}
	else{
		document.getElementById('imgCheck' + id).src = "/images/false.png";
		document.getElementById('inputCheck' + id).value = "false";
		check[id] = false;
	}
}

