$(document).ready(function () {
	Shadowbox.init({
		language:	"cs",
		players:	["img", "iframe", "swf"]
	});
	
	$(".kontakt_light").hover(
		function () {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		}
	);
});

function StartAnimace() {
    $('.slideshow').cycle({
		fx: 'fade',
		timeout: 7000,
		speed: 2000
	});
}

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 + " ";
		}
	}
}

