

// vytvorime nove okno, vlozime do nej obrazek a zavolame "prizpusobeni"
function showImage(img){

var js = "js/global.js";
var settings = "left=100,top=80,width=400,height=250, menubar=no,toolbar=no,location=no,status=yes";
var css = "*{margin:0; padding:0;} a img{border:0px;}"
var title = "ŘVC ČR";
var html = "";

win = window.open("","a",settings);

html  = "<html><head><title>"+title+"</title>";
html += "<style type='text/css'>"+css+"</style>";
html += "<script type='text/javascript' src='"+js+"'></script></head>";
html += "<body>";
html += "<a onclick='window.close()'><img src='"+img+"' onload='fitImage();'></a>";
html += "</body></html>";

win.document.write(html);
win.document.close();

}//


// prizpusobime velikost okna obrazku
function fitImage(){

iWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
iHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;

leftPo = (screen.availWidth - document.images[0].width)/2;
topPo = (screen.availHeight - document.images[0].height)/2;

window.resizeBy(iWidth, iHeight);
window.moveTo(leftPo, topPo);

self.focus();

}//



// tisk dokumentu
function goprn() {

var notice = "Moderní prohlížeče vytisknou stránku s využitím stylů připravených pro tisk.\n\nChcete vytisknout tuto stránku?";

  if(confirm(notice)){
  window.print();
  }

}


// doporuceni tiskove zpravy
function gomail() {

var notice = "Bude otevřen váš poštovní klient pro zpracování e-mailu.\n\nChcete pokračovat?";
var link = document.location.href;
var mail = "mailto:?subject=Zajimavy clanek na serveru rvccr.cz&body=RVC CR%20Vam%20doporucuje%20nasledujici%20clanek.%0A%0A" + link;

  if(confirm(notice)){
  document.location.href=mail;
  }

}



// skryvane zalozky
function showHide(id){
el = document.getElementById(id).style;
el.display = (el.display == 'block')? 'none' : 'block';
}

