function showSubMenu( id ) {
   var x=document.getElementById(id);
   x.style.display='block';
}

function hideSubMenu( id ) {
   var x=document.getElementById(id);
   x.style.display='none';
}


function sevent() {
   var sel_v = document.category.category_select.value;
   var hidden_box = document.getElementById('hidden_box');
   //var hidden_box2 = document.getElementById('hidden_box2');
   var sp_nazov = document.getElementById('sp_nazov');
   hidden_box.style.visibility = 'hidden';
   //hidden_box2.style.visibility = 'hidden';
   //document.category.category_select.selectedIndex = 2;
   //alert("xx= "+xx);
   var url_box = document.getElementById('url_box');
   var modul_box = document.getElementById('modul_box');
   
   if( sel_v == "url" ) {
      hidden_box.style.visibility = 'visible';
     // hidden_box2.style.visibility = 'visible';
      modul_box.style.display = 'none';
      url_box.style.display = 'block';
      sp_nazov.innerHTML = "Zadajte url:";
   }
   
   if( sel_v == "modul" ) {
      hidden_box.style.visibility = 'visible';
      //hidden_box2.style.visibility = 'visible';
      url_box.style.display = 'none';
      modul_box.style.display = 'block';
      sp_nazov.innerHTML = "Vyberte Modul:";
   }

}

function emptyField(id) {
   var titulok = document.getElementById(id);
   titulok.value = "";
}

$(function () {
		$('.h_image').hide();//hide all the images on the page
	});
	
	var i = 0;//initialize
	var int=0;//Internet Explorer Fix
	$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
		var int = setInterval("doThis(i)",500);//500 is the fade in speed in milliseconds
	});

	function doThis() {
		var imgs = $('.h_image').length;//count the number of images on the page
		if (i >= imgs) {// Loop the images
			clearInterval(int);//When it reaches the last image the loop ends
		}
		$('.h_image:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
		i++;//add 1 to the count
	}
	 
	$(function(){
	$("#faded").faded({
		speed: 3000,
		crossfade: true,
		autoplay: 500,
		autorestart: true
	});
});
