$(document).ready(function(){   	
	$('.anythingSlider').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 3000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 600,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Spustiť",                // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
	});
            
	$("#slide-jump").click(function(){
		$('.anythingSlider').anythingSlider(6);
	});
	
});

$(window).load(function() {
	$('#mnu2d').slideDown('slow');
});

	function doShowElement(elemshow,elemhide) {
		document.getElementById(elemshow).style.display = 'block';
		document.getElementById(elemhide).style.display = 'none';
	}
	
	function doOpenWindow(Awindow) {
		window.open('/'+Awindow+'.php','tmpwin','left=100,top=100,width=400,height=500,toolbar=0,resizable=0,scrollbars=1');
	}
	
	function popup(image,w,h) {
		var wid = 650;
		var hei = 490;
		windowHandle = window.open ('/web/popup.php?img='+image+'&sirka='+w+'&vyska='+h,'popup','width='+wid+',height='+hei+',top=100,left=100,resizable=yes,scrollbars=yes');
		windowHandle.focus();
	}
	
	function BlankState(elem) {
  		document.getElementById(elem).value = '';
  	}
	
	function ChangeState(elem) {
  		document.getElementById(elem).style.backgroundColor = "#F5F5F5";
  	}
	
	function AddProductIsEmpty(form) {
		var go_on = "ok";
		
		if ((isNaN(form.prodks.value)) || (form.prodks.value < '0'))  {
			form.prodks.style.backgroundColor = 'white';
			form.prodks.value = '';
			go_on = "no";
		}
		
		if (go_on == "no") { return false; }
		else { return true; }
	}
