$(document).ready(function () {
	Shadowbox.init({
		language:	"cs",
		players:	["img", "iframe", "swf"]
	});
});


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 + " ";
		}
	}
}

function IsEmail(address) {
	re = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	return address.search(re) == 0;
}

function IsBlank(value) {
	re = /^( )*$/;
	return value.search(re) == 0;
}

