var ofset = 0;
var max = 0;


function getUp(fold,img,ofs,txt,isVid){
  //document.getElementById('mainimg').src='wait30.gif';
  ofset = Number(ofs);
  
  if(isVid){
  var i = document.getElementById('mainimgbox');
  //var s = "<div id=\"flowplayerholder\">This will be replaced by the player. </div>";
  var s = '<a href="http://www.skoladesignu.sk/wks/'+fold+'/pict/'+img+'.flv"  style="display:block;width:395px;height:295px"  id="flowplayerholder"></a>';

  i.innerHTML = s;
  flowplayer("flowplayerholder", "flowplayer-3.1.2.swf", { 
      clip: { 
        onStart: function() { 
            document.getElementById('stitok').innerHTML = decodeURI(txt); 
        },
        onFinish: function() { 
            document.getElementById('stitok').innerHTML = 'koniec';
            goNext(); 
        },
        canvas: {backgroundColor: "#860d04"}
        },
        plugins: {
        controls: {
          progressColor: '#52001e',
          durationColor: '#ffffff',
          progressGradient: 'medium',
          volumeSliderColor: '#000000',
          timeBgColor: '#555555',
          sliderColor: '#000000',
          bufferColor: '#860b04',
          tooltipTextColor: '#ffffff',
          borderRadius: '10',
          backgroundGradient: 'low',
          tooltipColor: '#5F747C',
          timeColor: '#860b04',
          sliderGradient: 'none',
          backgroundColor: '#222222',
          bufferGradient: 'none',
          volumeSliderGradient: 'none',
          buttonColor: '#860b04',
          buttonOverColor: '#728B94',
          height: 20,
          opacity: 1.0
        }
        }
      }
    ); 
    
  }else{
  var i = document.getElementById('mainimg');
  var s = "/wks/"+fold+"/pict/"+img+".jpg";
  //alert(s);
  i.src = s;
  document.getElementById('stitok').innerHTML = decodeURI(txt);
  }

}
function goPrev(){
//document.getElementById('mainimg').src='wait30.gif';
ofset = ofset-1;
if(ofset<1)ofset = max;
window.frames['newgal'].goTo(ofset);
}
function goNext(){
//document.getElementById('mainimg').src='wait30.gif';
ofset = ofset+1;
if(ofset>max)ofset = 1;
window.frames['newgal'].goTo(ofset);
}

function setMax(m){
  max = m;
}