hs.graphicsDir = '../highslide/graphics/';
hs.align = 'center';
hs.transitions = ['fade']; // ["expand", "crossfade"]; //
hs.outlineType = 'rounded-white';
hs.fadeInOut = false;
hs.dimmingOpacity = 0.15;
hs.transitionDuration = 100;
hs.outlineWhileAnimating = true;


// Add the controlbar
hs.addSlideshow({
	slideshowGroup: 'slideshowgroup',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: 0.75,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});

var galleryOptions = {
	slideshowGroup: 'slideshowgroup',
      fadeInOut: false,
      //transitions:  ['expand', 'crossfade'],
      transitions:  ['fade'],
};


   hs.onDimmerClick = function() {
      return false;
   }



function SlideUp(elemID,i){

  from = 115;
  to = 73

  if (i>=to){
     i--;
     document.getElementById(elemID).style.marginTop=i+'px';
     setTimeout("SlideUp('"+elemID+"','"+i+"')",9)
  }

}


function SlideUpAll(max,zalozka){
   if (zalozka<=max){
      SlideUp('z'+zalozka,115);
      zalozka++;
      setTimeout("SlideUpAll('"+max+"','"+zalozka+"')",50);
   }
}

function iActive(stav,elem){
  switch(stav){
  case 'on':      elem.style.borderColor='#97BE25'; elem.style.backgroundColor='#ffffff'; break;
  case 'off':     elem.style.borderColor='#7CAEDC'; elem.style.backgroundColor='#ffffff'; break;
  case 'error':   elem.style.borderColor='#BE1F2D'; elem.style.backgroundColor='#f4acb1'; break;
  }
}

function webcamRefresh(){
  now = new Date();
  document.getElementById('webcam').src='http://www.oslavany.net/images/cam/vodarna000M.jpg?'+now.getTime();
  document.getElementById('webcamHref').href='http://www.oslavany.net/images/cam/vodarna000M.jpg?'+now.getTime();
  setTimeout('webcamRefresh()',10000);
}

function kontrolaPrispevek(idClanku){
 var errmsg = '';
 text = getEditorHTMLContents('text');
 if (text == '' || text == '&nbsp;' || text == '<br />') errmsg += 'Prázdný příspěvek nemůže být odeslán.';
 if (errmsg!='') {
  alert(errmsg);
 }else{
  if (document.post.predmet.value==''){
   var q = confirm('Předmět je prázdný, opravdu chcete příspěvek odeslat bez předmětu?');
  }
  if (document.post.predmet.value!='' || q){
   document.post.action = '?clanek='+idClanku+'&action=savePost';
   document.post.submit();

  }
 }


}

// Get the content editor
function getEditorHTMLContents(EditorName) {
var oEditor = FCKeditorAPI.GetInstance(EditorName);
return (oEditor.GetXHTML(true));
}

function emptyInput(clearValue,inp){
 if (inp.value==clearValue) inp.value = "";
}

function zmen(radek, stav, barva)
{
   if (stav=="ON"){
    if (barva==''){barva="#94C523";} // vychozi barva
    radek.style.background=barva;
   };
   if (stav=="OFF"){
    radek.style.background=barva;
   };
}



function keepServerInfo(){
      cti('/ajax.php?modul=online&action=keepServerInfo','null');
      setTimeout("keepServerInfo()",30000);
}

function warnEdit(){
 alert("Tyto údaje nemohou být změněny on-line.\nPro převod členství využijte dokument Žadost o převod členství.\nPro změnu adresy nám prosím pošlete zprávu (e-mail, helpdesk).");
 document.src.telefon_pevna.focus();
}

function showOverlay(){
   var overlayHeight = Viewport('pageY');
   document.getElementById('overlay').style.height=overlayHeight + 'px';
   document.getElementById('overlay').style.display='';
}

function hideOverlay(){
   document.getElementById('overlay').style.display='none';
}

