$(function () {
	$(".jsonly").show();

	// a.blank jako target blank
	$("a.blank").each(function () {
		$(this).click(function () {
			window.open(this.href);
			return false;
		});
	});

	// Tabulky
	$("table tr:odd").addClass("odd");
	$("table tr:even").addClass("even");

	// generátor
	checkDependents("window");
	checkDependents("image");
	checkDependents("link");

	$.texyla();
});

function checkDependents(type) {
	$("#generator-form ." + type + "-dependent").click(function () {
		var win = $("#generator-form ." + type).get(0);
		if (this.checked && !win.checked) {
			win.checked = true;
		}
	});

	$("#generator-form ." + type).click(function () {
		if (!this.checked) {
			$("#generator-form ." + type + "-dependent").each(function () {
				this.checked = false;
			});
		}
	});
}