$(document).ready(function () {
	Shadowbox.init({
		language:	"cs",
		players:	["img", "iframe", "swf"]
	});
});

$(window).load(function() {
    $('#slider').nivoSlider({
        effect: 'fade',
        animSpeed:2000, 
        pauseTime:5000, 
        startSlide:0, 
        directionNavHide:false
    });
});

$(function() {

	// initialize scrollable
	$(".scrollable").scrollable();

});

function smile(c) {
	var a = document.koment.zprava;
	var tmp = a.value;

	if (document.selection) {
		a.focus();
		var sel = document.selection.createRange();
		if(sel.parentElement() != a) { 
			return false; 
		} 
		sel.text = " " + c + " ";
	}
	else {
		if(a.selectionStart || a.selectionStart == 0) {
			var sPos = a.selectionStart;
			c = ((tmp[a.selectionEnd-1]==" ") ? "" : " ") + c + ((tmp[a.selectionEnd]==" ") ? "" : " ");
			a.value = tmp.substring(0, a.selectionEnd) + c + tmp.substring(a.selectionEnd) ;
			a.focus();
			a.selectionStart = a.selectionEnd = sPos + c.length;
		}
		else {
			a.value = a.value + " " + c + " ";
		}
	}
}

