// Smajlici

function add_smile(t)
{ 
  document.knihasmile.prispevek.value+= '' + t + ''; 
}

// Funkce pro otvírání obrázku do nového okna se zadanými parametry
  
function MM_openBrWindow(theUrl, winName, features) {
  secondWindow=window.open(theUrl, winName, features);
}


// Změna barvy pozadí

function setBackgroundColor(color) {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      /*a.disabled = !(a.getAttribute("title") == color);
      if(a.getAttribute("title") == color)
        alert(a.getAttribute("title"));*/
      
      a.disabled = true;
      if(a.getAttribute("title") == color) a.disabled = false;
    }
  }
  
  currentBackgroundColor = color;
}


// Přidání mezi oblíbené stránky

function AddFavorite(linkObj,addUrl,addTitle) { 
  if (document.all && !window.opera) 
  { 
    window.external.AddFavorite(addUrl,addTitle); 
    return false; 
  } 
  else if (window.opera && window.print) 
  { 
    linkObj.title = addTitle; 
    return true; 
  } 
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) 
  { 
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?')) 
    { 
      window.sidebar.addPanel(addTitle,addUrl,''); 
      return false; 
    } 
  } 
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.'); 
  return false; 
} 


// Slideshow

var SlideShowSpeed = 3000;
var CrossFadeDuration = 3;
var Picture = new Array();

Picture[1]  = 'img/foto01.gif';
Picture[2]  = 'img/foto02.gif';
Picture[3]  = 'img/foto03.gif';
Picture[4]  = 'img/foto04.gif';
Picture[5]  = 'img/foto05.gif';
Picture[6]  = 'img/foto06.gif';
Picture[7]  = 'img/foto07.gif';
Picture[8]  = 'img/foto08.gif';
Picture[9]  = 'img/foto09.gif';
Picture[10]  = 'img/foto10.gif';
Picture[11]  = 'img/foto11.gif';
Picture[12]  = 'img/foto12.gif';
Picture[13]  = 'img/foto13.gif';
Picture[14]  = 'img/foto14.gif';
Picture[15]  = 'img/foto15.gif';
Picture[16]  = 'img/foto16.gif';
Picture[17]  = 'img/foto17.gif';
Picture[18]  = 'img/foto18.gif';
Picture[19]  = 'img/foto19.gif';
Picture[20]  = 'img/foto20.gif';

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.schema.style.filter="blendTrans(duration=2)";
document.images.schema.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.schema.filters.blendTrans.Apply();}
document.images.schema.src = preLoad[jss].src;
if (document.all) document.images.schema.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}
