// UI

//slider
$(document).ready(function(){	
	$("#slider").easySlider({
		auto: true,
		continuous: true 
	});
});	
$(function() {
    $("#1, #2, #3").lavaLamp({
        fx: "backout",
        speed: 500
    });
});
//ksiega

function zliczaj_znaki() {
if(document.ksiega.wpis.value.length<501){
a=document.ksiega.wpis.value.length
b=500;
c=b-a;

var browser_type=navigator.appName

if(browser_type=="Microsoft Internet Explorer"){
	document.all.znak.innerHTML = c;
}
if(browser_type=="Netscape"){
	znak = document.getElementById("znak");
	znak.innerHTML = c;
}

}
else{
alert('Przekroczono dozwoloną ilość znaków przeznaczoną na wpis');
}}

function error(elem, text) {
 if (errfound) return;
 window.alert(text);
 elem.select();
 elem.focus();
 errfound = true;
}
function Validate() {
 errfound = false;
  if (document.ksiega.nick.value == ""){
 error(document.ksiega.nick,"Dlaczego się nie przedstawisz?\nPodaj swoje imię i nazwisko lub nick.");
}
if (document.ksiega.wpis.value == ""){
 error(document.ksiega.wpis,"Uzupełnij wpis.");
}
 return !errfound;
}

function emoticon(text) {
  text = ' ' + text + ' ';
  if (document.ksiega.wpis.createTextRange && document.ksiega.wpis.caretPos) {
   var caretPos = document.ksiega.wpis.caretPos;
   caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
   document.ksiega.wpis.focus();
  } 
  else {
    document.ksiega.wpis.value  += text;
	document.ksiega.wpis.focus();
  }
}

