var wind;
function win(n, f, w, h) {
	if (typeof(wind) == "object") {
		wind.close();
	}
	x = Math.round((window.screen.width - w) / 2);
	y = Math.round((window.screen.height - h) / 2 / 2);
	wind = window.open('', '', 'scrollbars=no,noresizable,height='+h+',width='+w+',top='+y+',left='+x);
	wind.document.open();
	wind.document.write('<html><head><title>'+ n +'</title><style type="text/css">body {margin:0px;overflow:hidden;} img {border:0}</style></head><body><a href="#" onclick="window.close(); return false"><img src="'+f+'" alt="'+ n +'" title="'+ n +'" /></a></body></html>');
	wind.document.close();
	return true;
}



function smajlici(text) {
	  document.form.zprava.value = document.form.zprava.value+text;
	  document.form.zprava.focus();
	}
	
function zkontroluj(formular)
{
	
	if (formular.jmeno.value=="")
    {
        alert("Vaše jméno (přezdívku) musíte vyplnit!");
        formular.jmeno.focus();
        return false;
    }
   
  else if (formular.zprava.value=="")
    {
        alert("Text zprávy musíte vyplnit!");
        formular.zprava.focus();
        return false;
    }
    
  else if (formular.spam.value!="xx")
    {
        alert("Do pole ochrany proti spamu vepište dvakrát x! Jinak zpráva bude brána jako spam a nebude zobrazena!");
        formular.spam.focus();
        return false;
    }

  else if (formular.email.value!="")
    {

        re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$");
        if (!re.test(formular.email.value))
        {
            alert("Zadaná adresa není správnou adresou elektronické pošty!");
            formular.email.focus();
            return false;
        }

    }
    
  

    else 
        return true;
}


function zkontroluj_add_tip(formular)
{
	
	if (formular.misto.value=="")
    {
        alert("Město kde se akce koná musíte vyplnit!");
        formular.misto.focus();
        return false;
    }
    
  else if (formular.klub.value=="")
    {
        alert("Klub kde se akce koná musíte vyplnit!");
        formular.klub.focus();
        return false;
    }
    
  else if (formular.kapely.value=="")
    {
        alert("Kapely musíte vyplnit!");
        formular.kapely.focus();
        return false;
    }
    
  else if (formular.mail.value=="")
    {
        alert("Váš e-mail musíte vyplnit!");
        formular.mail.focus();
        return false;
    }
  else if (formular.spam.value!="xx")
    {
        alert("Do pole ochrany proti spamu vepište dvakrát x! Jinak zpráva bude brána jako spam a nebude akceptována!");
        formular.spam.focus();
        return false;
    }
    
  else 
        return true;
}



function zkontroluj_soutez(formular)
{
  if (formular.jmeno.value=="")
    {
        alert("Vaše jméno (přezdívku) musíte vyplnit!");
        formular.jmeno.focus();
        return false;
    }
    
	else if (formular.odpoved.value=="")
    {
        alert("Odpověď musíte vyplnit!");
        formular.odpoved.focus();
        return false;
    }
    
  else if (formular.ulice.value=="")
    {
        alert("Ulici a č.p. musíte vyplnit!");
        formular.ulice.focus();
        return false;
    }
    
  else if (formular.mesto.value=="")
    {
        alert("Město musíte vyplnit!");
        formular.mesto.focus();
        return false;
    }
    
  else if (formular.psc.value=="")
    {
        alert("PSČ musíte vyplnit!");
        formular.psc.focus();
        return false;
    }
	
    
  else if (formular.mail.value=="")
    {
        alert("Váš e-mail musíte vyplnit!");
        formular.mail.focus();
        return false;
    }
    
  else if (formular.mail.value!="")
    {

        re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$");
        if (!re.test(formular.mail.value))
        {
            alert("Zadaná adresa není správnou adresou elektronické pošty!");
            formular.mail.focus();
            return false;
        }

    }
    
  else 
        return true;
}


function clear_box(hodnota){
		document.forms[0].email.value=hodnota;
}

function validate_reg(formular)
{
 
        if (formular.email.value=="")
        {
         alert("Musíte zadat email");
         formular.email.focus();
         return false;
        }
        else if (window.RegExp)
        {
         re = new RegExp("^[^@]+@[^.]+\..+$");
         if (!re.test(formular.email.value))
         {
          alert("Zadaný email není platný");
          formular.email.focus();
          return false;
         }
        }
    else
          return true;
}
 
var win;
function open_player() {
	w = 357;
	h = 260;
	x = Math.round((window.screen.width - w) / 2);
	y = Math.round((window.screen.height - h) / 2 / 2);
	win = window.open('', '', 'scrollbars=no, noresizable, height='+ h +', width='+ w +', top='+ y +', left='+ x +'');

	win.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	win.document.writeln('<head>');
	win.document.writeln('	<meta http-equiv="content-type" content="text/html; charset=windows-1250" />');
	win.document.writeln('	<meta http-equiv="Content-language" content="cs" />');
	win.document.writeln('	<title>KvakPunkRock.cz - on-line mp3 player</title><style type="text/css">body {margin:0px;overflow:hidden;} img {border:0}</style>');
	win.document.writeln('	<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen,print" />');
	win.document.writeln('</head>');
	win.document.writeln('<body class="player">');
	win.document.writeln('<script type="text/javascript" src="/js/player_b.js"></script>');
	win.document.writeln('<noscript>');
  win.document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="355" height="255" id="big_player" align="middle">');
  win.document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
  win.document.writeln('<param name="movie" value="/prehravac/big_player.swf" />');
  win.document.writeln('<param name="quality" value="high" />');
  win.document.writeln('<param name="bgcolor" value="#ffffff" />');
  win.document.writeln('<embed src="/prehravac/big_player.swf" quality="high" bgcolor="#ffffff" width="355" height="255" name="big_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  win.document.writeln('</object>');
  win.document.writeln('</noscript>');
  win.document.writeln('<div class="refresh" style="position:absolute;left:10px;top:120px;z-index:-1;"><a title="refresh" onclick=javascript:location.reload(); href="#">pokud se vám přehrávač nenačetl, klikněte zde</a></div>');
	win.document.writeln('</body>');
	win.document.writeln('</html>');
}

function otazka(otazka) {
    var pokracovat;
	  pokracovat = confirm(otazka);
// nyní mám v proměnné pokracovat uloženo true nebo false
    if(pokracovat) {
    return true;
    }
    else {
    return false;
    }
}

function open_win(n, w, h) {
	x = Math.round((window.screen.width - w) / 2);
	y = Math.round((window.screen.height - h) / 2 / 2);
	win = window.open(n, '_blank', 'scrollbars=no, noresizable, height='+ h +', width='+ w +', top='+ y +', left='+ x +'');
}
