jQuery(document).ready(function(){
    var int = setTimeout(function() {
    	prepniNaDruhou();
    }, 10000);

	jQuery("div.naprvni").click(function(){
		clearTimeout(int);
		prepniNaPrvni();
	});
	jQuery("div.nadruhou").click(function(){
		clearTimeout(int);
		prepniNaDruhou();
	});
	jQuery("div.natreti").click(function(){
		clearTimeout(int);
		prepniNaTreti();
	});
	function prepniNaPrvni() { 
		jQuery("div#odkaz-aktualita").css("display","block");
		jQuery("div#odkaz-projekt-1").css("display","none");
		jQuery("div#odkaz-projekt-2").css("display","none");
		int = setTimeout(function() {
	    	prepniNaDruhou();
	    }, 10000);
	};
	function prepniNaDruhou() { 
		jQuery("div#odkaz-aktualita").css("display","none");
		jQuery("div#odkaz-projekt-1").css("display","block");
		jQuery("div#odkaz-projekt-2").css("display","none");
		int = setTimeout(function() {
			prepniNaTreti();
	    }, 5000);
	};
	function prepniNaTreti() { 
		jQuery("div#odkaz-aktualita").css("display","none");
		jQuery("div#odkaz-projekt-1").css("display","none");
		jQuery("div#odkaz-projekt-2").css("display","block");
		int = setTimeout(function() {
			prepniNaPrvni();
	    }, 5000);
	};

});
function DoNav(theUrl) {
	document.location.href = theUrl;
}
function toggleLayer( whichLayer) {
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
