version = navigator.appVersion.toLowerCase();
agent = navigator.userAgent.toLowerCase();
ie = (version.indexOf('msie')>-1);
win = (version.indexOf('windows')>-1);
opera = (agent.indexOf('opera')>-1);

function prn() {
document.write('\074a a  title="Zobrazí dialog pro tisk stránky" class="print" href=\"javascript:goprn();\"\076Vytisknout\074/a\076');
}

function goprn() {
window.print();
}

function fav() {
if ((opera) && (win)) return false;
else if ((ie) && (win)) document.write(' | \074a title="Přidá stránku do oblíbených položek ve vašem prohlížeči" class="fav" href=\"javascript:gofav();\"\076Přidat k oblíbeným\074/a\076');
}

function gofav() {
window.external.addFavorite('http://hotelhrbolna.cz','Hotel pro psy, Valentin');
}

//**************************************************
//kniha navstev
function zkontroluj(formular){
if((formular.Jmeno.value=="") || (formular.Prispevek.value=="") || (formular.Email.value!="")){
	if (formular.Jmeno.value=="")
    {
        alert("Jméno je povinná položka!");
        formular.Jmeno.focus();
        return false;
    }
	if (formular.Prispevek.value=="")
    {
        alert("Text příspěvku je povinná položka!!");
        formular.Prispevek.focus();
        return false;
    } 
  re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$");
  if (!re.test(formular.Email.value))
        {
            alert("Zadaná adresa nemá správný tvar elektronické pošty!");
            formular.Email.focus();
            return false;
    } 

    }else 
        return true;
}

function emoticon(Prispevek) {
	var txtarea = document.formular.Prispevek;
	Prispevek = ' ' + Prispevek + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.Prispevek = caretPos.text.charAt(caretPos.Prispevek.length - 1) == ' ' ? Prispevek + ' ' : Prispevek;
		txtarea.focus();
	} else {
		txtarea.value  += Prispevek;
		txtarea.focus();
	}
}


function ShowFoto(Img, W, H){
	var ititle = "Foto - kliknutím okno zavřete | Valentin, výcvik psů" ;
	var win = window.open("","imageviewer","width="+W+",height="+H+",menubar=no,toolbar=no");
	win.document.open();
	win.document.write("<html><head><title>"+ititle+"</title>");
	win.document.write("</head><body onBlur=\"self.close()\" onClick=\"self.close()\">");
	win.document.write('<div style="position:absolute;width:'+W+'px;height:'+H+'px;left:0px;top:0px">');
	win.document.write("<img src="+escape(Img)+"></div></body></html>");
	win.document.close();
}

