if (document.getElementById && document.getElementsByTagName) {
if (window.addEventListener) window.addEventListener('load', initScrollBars, false);
else if (window.attachEvent) window.attachEvent('onload', initScrollBars);
}

function initScrollBars() {
CSBfleXcroll('text-obal-scroll');
}

$(document).ready(function(){
  /* lightbox */
	$("a[rel^='lightbox']").lightbox();
	/* lightbox konec */
	
	$("ul#TickerHorizontal").liScroll();
	 
	
	/* inicializace slidu */
	$(".NSmask").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		auto: 4000,
		speed: 350,
		btnGo:
    [".jBtn1", ".jBtn2", ".jBtn3", ".jBtn4", ".jBtn5", ".jBtn6", ".jBtn7", ".jBtn8"],
		visible: 1,
		mouseWheel: true
	});
	
	$(".akcni-panel").hover(function () {
		$(this).find(".buttons").css("display","block");
		return false;
	},
  function () {
    $(this).find(".buttons").css("display","none");
		return false;
  });
	
  /* inicializace slidu - konec */
  
	$("#banner-poslechovost-big").css("display","block");
	$("#banner-poslechovost-big").click(function() {
		$(this).css("display","none");
	});

});

function closeAll() {
	document.getElementById('podmenu1').style.display = "none";
	document.getElementById('podmenu2').style.display = "none";
	document.getElementById('podmenu3').style.display = "none";
	document.getElementById('podmenu4').style.display = "none";
}

function showMenu(id) {
	closeAll();
	document.getElementById(id).style.display = "block";
}

function closeAllForms() {
	document.getElementById('ukazto-prazdny-form').style.display = "none";
	document.getElementById('ukazto-video-form').style.display = "none";
	document.getElementById('ukazto-fotka-form').style.display = "none";
	document.getElementById('ukazto-vtip-form').style.display = "none";
}
function showForm(id) {
	closeAllForms();
	document.getElementById(id).style.display = "block";
}

function playRadio(kbps) {
	prewiev = window.open('player.asp?stream='+kbps,'','toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=500,height=350');
	prewiev.window.focus();
}

function kontrolanaprani() {
 if (document.naprani.jmeno.value == ""){
			alert("Zadejte svoje jméno");
    document.naprani.jmeno.focus();
    document.naprani.jmeno.select();
			return false;
			}
 if (document.naprani.hudebniprani.value == ""){
			alert("Vyplňte své hudební přání");
    document.naprani.hudebniprani.focus();
			return false;
			}
}

function kontrolakufrik() {
 if (document.kufrik.jmeno.value == ""){
			alert("Zadejte svoje jméno");
    document.kufrik.jmeno.focus();
    document.kufrik.jmeno.select();
			return false;
			}
 if (document.kufrik.kufrikprani.value == ""){
			alert("Vyplňte své hudební přání");
    document.kufrik.kufrikprani.focus();
			return false;
			}
}

function kontrolaukazto() {
 if (document.ukazto.jmeno.value == ""){
			alert("Zadejte svoje jméno");
    document.ukazto.jmeno.focus();
    document.ukazto.jmeno.select();
			return false;
			}
	if ((!document.ukazto.typ[0].checked) && (!document.ukazto.typ[1].checked) && (!document.ukazto.typ[2].checked)){
			alert("Vyber, co chceš poslat");
			return false;
			}

	if ((document.ukazto.typ[0].checked) && (document.ukazto.video.value == "")){
			alert("Zkopíruj URL adresu svého videa na YOUTUBE.COM");
      document.ukazto.video.focus();
			return false;
			}
	if ((document.ukazto.typ[1].checked) && (document.ukazto.foto.value == "")){
			alert("Vyber ze svého počítače fotku, kterou námj chceš poslat.");
      document.ukazto.foto.focus();
			return false;
			}
	if ((document.ukazto.typ[2].checked) && (document.ukazto.vtip.value == "")){
			alert("Napiš nám svůj ftip!");
      document.ukazto.vtip.focus();
			return false;
			}
}

function kontrolaseznamka() {
re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$/;

 if ((!document.seznamka.typ[0].checked) && (!document.seznamka.typ[1].checked) && (!document.seznamka.typ[2].checked)){
			alert("Vyber typ inzerátu");
			return false;
			}

 if (document.seznamka.inzerat.value == ""){
			alert("Napište svůj inzerát");
    document.seznamka.inzerat.focus();
    document.seznamka.inzerat.select();
			return false;
			}
 if (document.seznamka.email.value == ""){
			alert("Prosím, vyplňte svoji e-mailovou adresu.");
    document.seznamka.email.focus();
    document.seznamka.email.select();
			return false;
			}
//	Kontrola e-mailu
	if ( document.seznamka.email.value != "" ) {
		if (re.test(document.seznamka.email.value) == 0) {
			alert ("E-mailová adresa není ve správném formátu!");
			document.seznamka.email.focus();
			document.seznamka.email.select();
			return false;
		}
	}
			
} 

