
function confirmDeleteA(str)
{
	if(str=='')
		return confirm("Vymazať?");
	else
	    return confirm(str);
}

function confirmDelete(str)
{
    pokracuj = false;
	if (confirm(str)) {
		vymaz = document.getElementById('h_action');
		vymaz.value = 'delete';
		pokracuj = true;
	}
	return pokracuj;
}

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover(
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};

function startRotate() {
	setInterval("rotate()",4000);
}

function rotate() {
	var curr = ($("#imgflip img.show")?  $("#imgflip img.show") : $("#imgflip img:first"));

	var next = ((curr.next().length) ? ((curr.next().hasClass("show")) ? $("#imgflip img:first") :curr.next()) : $("#imgflip img:first"));

	next.addClass("show").fadeIn();
	curr.removeClass("show").fadeOut();
};


$().ready(function() {
	//startRotate();
	
	//$("a[href$='.pdf']").parent().prepend('<span class="ext pdf"></span>');
	$("a[href$='.pdf']").parent().addClass('pdf');
	$("a[href$='.doc']").parent().addClass('doc');
	$("a[href$='.xls']").parent().addClass('xls');
	$("a[href$='.ppt']").parent().addClass('ppt');
	$("a[href$='.zip']").parent().addClass('zip'); $("a[href$='.rar']").parent().addClass('zip');
	$("a[href$='.txt']").parent().addClass('txt');
	$("a[href$='.c']").parent().addClass('c');
	$("a[href$='.cpp']").parent().addClass('cpp');
    $("a[href$='.phps']").parent().addClass('php');


	if (document.all) {
		$(".main-menu li").hoverClass("sfHover");
	}
	
	$(".main-menu li").hover(
		function(){ $("ul", this).fadeIn("fast"); },
		function() {  }
	);


});

