//obrazky
    var myTWin = window.myTWin;
    
    function OpenMyWin(link,winName,sirka,vyska,popisek)
    {
      var retValue=true;
      if (myTWin!=null && !myTWin.closed)
      {
        myTWin.focus();
        myTWin.location.href=link.href;
      }
      else
      {
        myTWin=window.open(link.href,winName,'width='+sirka+',height='+vyska+',scrollbars=0,resizable=0,toolbar=0');
        myTWin.document.open('text/html');
        myTWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n');
        myTWin.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">\n');
        myTWin.document.write('<head>\n');
        myTWin.document.write('<meta http-equiv="content-type" content="text/html; charset=utf-8" />\n');
        myTWin.document.write('<meta name="Description" content="Chata Storm, Litovelsé Pomoraví" />\n');
        myTWin.document.write('<meta name="keywords" content="Chata Storm, Chata, Litovel, Litovelské Pomoraví, Ubytování, Olomouc" />\n');
        myTWin.document.write('<title>'+popisek+' - Stoyan\'s Page</title>\n');
        myTWin.document.write('<style>body { font:81.25%/1.4 Verdana,sans-serif; margin: 0; padding: 0; text-align: center; } #crumb {clear:left;width:100%;height:28px;line-height:28px;background:#165800 url("l1.gif") no-repeat 0 0;color:#D5DDC4} #crumbin {background: url("l2.gif") no-repeat top right;padding-left:10px;} img { border-style: none; }</style>\n');
        myTWin.document.write('</head>\n');
        myTWin.document.write('<body>\n');
        myTWin.document.write("<a href=\"javascript:window.close('close')\">\n");
        myTWin.document.write('<img src=\"'+link.href+'\"');
        myTWin.document.write(' width=\"'+sirka+'\" height=\"'+vyska+'\" alt="'+popisek+'" /></a>\n');
        myTWin.document.write('</body>\n');
        myTWin.document.write('</html>');        
        myTWin.document.close();
        if (myTWin==null || typeof(myTWin)=="undefined")
          retValue=false;
        else
        {
          link.target=winName;
          myTWin.focus();
        }
      }
      return retValue;
    }

//kontrola formulare
function zkontroluj(formular) 
{ 
     var podminka1=true;
     var podminka2=true;
     var podminka3=true;
     var podminka4=true;
     
     //kontrola vyplneni jmena 
     if (formular.komentar_autor.value=="")
     { 
        alert("Zapomněl jsi vyplnit nick!"); 
        formular.komentar_autor.focus(); 
        podminka1=false; 
     }
     
     //kontrola spravnosti url
     if (!(new String(formular.komentar_web.value)).match(/http:\/\//))
     {
         alert("Zapiš http:// na začátek URL svého webu!");
         formular.komentar_web.focus();
         podminka2=false;
     }
     
     //kontrola spravnosti emailu
     if (!(new String(formular.komentar_mail.value)).match(/@/))
     {
         podminka3=false;
     }
     if (formular.komentar_mail.value=="")
     { 
        podminka3=true; 
     }
     if (podminka3==false)
     { 
        alert("Zadal jsi email v nesprávném tvaru!");
        formular.komentar_web.focus(); 
     }
     
     //kontrola vyplneni obsahu
     if (formular.komentar_obsah.value=="")
     { 
        alert("Zapomněl jsi vyplnit tělo příspěvku!"); 
        formular.komentar_obsah.focus(); 
        podminka4=false; 
     }
     
     if ((podminka1==true) && (podminka2==true) && (podminka3==true) && (podminka4==true))
        return true; 
     else 
        return false;
} 

//vkladani smajliku na board
/*puvodni
function vloz(smajlik)
{
    var zprava = document.getElementById("teloprispevku");
    zprava.value += smajlik;
    zprava.focus();
}
*/

//novy od Zenera - diky
function vloz(nahr_text) {
		//Internet Explorer
			if (document.selection) 
      {
				document.getElementById('teloprispevku').focus();
				sel = document.selection.createRange();
				sel.text = nahr_text;
			}
		//Firefox
			else if (document.getElementById('teloprispevku').selectionStart || document.getElementById('teloprispevku').selectionStart == '0') {
				var startPos = document.getElementById('teloprispevku').selectionStart;
				var endPos = document.getElementById('teloprispevku').selectionEnd;
				document.getElementById('teloprispevku').value = document.getElementById('teloprispevku').value.substring(0, startPos)
								+ nahr_text
								+ document.getElementById('teloprispevku').value.substring(endPos, document.getElementById('teloprispevku').value.length);
			} else {document.getElementById('teloprispevku').value += nahr_text;}
			
			document.getElementById('teloprispevku').focus();
		 }

