//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
//kontrola verze flashe script je v souboru AC_OETags.cz
//stahnuty primo od ADOBE
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
// Potrebna verze flash playera pro spravny chod prehravani
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -----------------------------------------------------------------------------
//vola kontrolu flashe..vypadne bud true nebo false
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
//--------------------------------------------------
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------






//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
//definice pro funkce rolovani videa a zobrazovani videa
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
var rychlost = 15//rychlost posouvani, cim mensi cislo, tim rychlejsi
var bl
var new_sirka
var casovani_spust
var casovani_spust1
var casovani_spust3
var casovani_spust4
var casovani_spust5
var pauza
var kam
var cas_pauza=1000
var idecko='video';
var cesticka='http://www.fkteplice.cz/php/new/video_ajax.php?video=';
var ob;
bl=0
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------





//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
//definice pro funkce rolovani videa a zobrazovani videa
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------



//scrolovani dolu
function scrolly(){
	kam=1
		if(celavyska-vyskabloku>bl)
		{
			document.getElementById("seznam").scrollTop=bl
			bl++
		}
}



//scrolovani nahoru
function scrollzpet(){
	kam=0
		if(0<bl)
		{
			document.getElementById("seznam").scrollTop=bl
			bl--
		}
}



//pri sjeti mysi zastavi se scrolovani
function zastav(){
		window.clearInterval(casovani_spust1)
		window.clearInterval(casovani_spust3)
		window.clearInterval(casovani_spust)
		window.clearInterval(pauza)
}


//spousteni scrollovani nahoru
function nahoru(){
	casovani_spust3 = setInterval("scrollzpet()",rychlost)
}



//spousteni scrollovani dolu
function dolu(){
	casovani_spust1 = setInterval("scrolly()",rychlost)
}






//funkce pro zobrazovani videa pres ajax
function zobraz($a,$b)
{    var a
     //var url = document.getElementById("vyber").value;
      var url=$a;
      var element=$b;

     if (url != 0)
     {
        if (window.ActiveXObject)
        {
          httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else
        {
          httpRequest = new XMLHttpRequest();
        }
        httpRequest.open("GET", url, true);
        httpRequest.onreadystatechange= function () {processRequest(element); } ;
        httpRequest.send(null);
      }
      else
      {

        document.getElementById(element).innerHTML = "bug";

      }
}




//funkce pro zobrazovani videa pres ajax
function processRequest($b)
{var element=$b;
  if (httpRequest.readyState == 4)
  {
    if(httpRequest.status == 200)
    {
     var mistoZobrazeni = document.getElementById(element);


   //alert (element);
       document.getElementById(element).innerHTML = '';

      mistoZobrazeni.innerHTML = httpRequest.responseText;
      //mistoZobrazeni.style.visibility='visible';
       //myLightbox = new Lightbox();
    }
    else
    {
        alert("Chyba pri nacitani stanky"+ httpRequest.status +":"+ httpRequest.statusText);
    }
  }
}








//funkce ktera pokud je verze flashe spravna zobrazuje video nebo alternativni hlasku
function ukaz(vid,obrid){
	var vid
	var obrid
	//var adresa=cesticka+vid
var adresa=cesticka+vid+"/"+obrid;
//alert(adresa);
		//na zacatku tohoto souboru kontorluje verzi flase, script od adobe
		//pokud je vezrze dostacujisi hodi true a zavola se video
	if (hasReqestedVersion)
	{
		zobraz(adresa,idecko)

	}
	else
		{  //pokud je verze stara zobrazi se tato alternativni hlaska
			var alternateContent = 'Vaše verze Adobe Flash Player je zastaralá,<br />'
			+ 'nebo není nainstalován, proveďte aktualizaci. '
			+ '<a href=http://www.adobe.com/go/getflash/>ZDE</a>';
			document.getElementById(idecko).innerHTML=(alternateContent);  // insert non-flash content
		}

}

//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
