
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 href=\"javascript:goprn();\"\076Vytisknout\074/a\076');
} // end function prn


function goprn() {
window.print();
} // end function goprn


function fav() {
if ((opera) && (win)) return false;
else if ((ie) && (win)) document.write('&nbsp;|&nbsp;\074a href=\"javascript:gofav();\"\076<strong>Přidat k oblíbeným</strong>\074/a\076');
} // end function


function gofav() {
window.external.AddFavorite('http://www.strelnicejimi.cz/', 'Střelnice JIMI - Odrava u Chebu');
} // end function gofav


function WindowPrint(url) {
  w = 800;
  h = 600;
  x = screen.width/2-w/2;
  y = screen.height/2-h/2-50;
  if (x<0) x = 0;
  if (y<0) y = 0;
  o = window.open(url, '', 'width=' + w + ', height=' + h + ', top=' + y + ', left=' + x + ', resizable=yes, scrollbars=yes');
  d = o.document;
  d.close();
} // end function WindowPrint


function WindowNew(sAdres, iWidth, iHeight, sTitle, iReturn){
if (!sTitle)
  sTitle = '';
if(!iReturn)
  iReturn = false;

if(!iWidth)
  var iWidth = 750;
if(!iHeight)
  var iHeight = 530;

if(+iWidth > 750)
  iWidth = 750;
else
  iWidth = +iWidth + 40;

if(+iHeight > 530)
  iHeight = 530
else
  iHeight = +iHeight + 40;

var iX = (screen.availWidth - iWidth) / 2;
var iY = (screen.availHeight - iHeight) / 2;

var refOpen = window.open(sAdres, sTitle, "height="+iHeight+", width="+iWidth+", top="+iY+", left="+iX+", resizable=yes, scrollbars=yes, status=0;");

if(iReturn == true)
  return refOpen
} // end function WindowNew


function WindowFoto(url, w, h) {
  if (!w) w = 600;
  if (!h) h = 400;
  x = screen.width/2-w/2;
  y = screen.height/2-h/2-50;
  if (x<0) x = 0;
  if (y<0) y = 0;
  o = window.open('', '', 'width=' + w + ', height=' + h + ', top=' + y + ', left=' + x + ', resizable=no, scrollbars=no');
  d = o.document;
  d.writeln('<html><head><title>Kliknutím zavřít...</title><meta http-equiv="imagetoolbar" content="no"></head>');
  d.writeln('<body style="text-align: center; margin: 0; padding: 0; cursor: pointer;">');
  d.writeln('<img src="' + url + '" onclick="javascript:window.close();" width="' + w + '" height="' + h + '" alt="" title="Kliknutím zavřít..." border="0">');
  d.writeln('</body></html>');
  d.close();
} // end function WindowFoto


function CheckForm(KontaktForm) {
  var problem = 'Ne';
  var hlaseni = 'Vyplňte všechny povinné položky! \n\n';
  if (document.KontaktForm.zprava.value.length <= 0) {
    hlaseni = hlaseni+"- vložte text zprávy \n";
    document.KontaktForm.zprava.style.borderColor = 'red';
    document.KontaktForm.zprava.focus();
    problem = 'Ano';
  } else {
    document.KontaktForm.zprava.style.borderColor = '#7f8db9';
  }
  if (problem == 'Ne') {
    return true;
  } else {
    alert (hlaseni);
    return false;
  }
} // end function CheckForm

