var box
var content
var contentHeight
var boxHeight
var contentTop
var scrollIt
var idBox


if (!document.getElementById && document.all) document.getElementById = document.all;
function setSize() {
 var i, a;
 a=setSize.arguments;
 box = new Array();
 content = new Array();
 contentHeight = new Array();
 boxHeight = new Array();
 contentTop = new Array();
 
 for(i=0; i<a.length; i++) {
  box[a[i]] = document.getElementById("scroll"+a[i]);
  content[a[i]] = document.getElementById("obsah"+a[i]);
  contentHeight[a[i]] = content[a[i]].offsetHeight;
  boxHeight[a[i]] = box[a[i]].offsetHeight;
  contentTop[a[i]] = 0;
 }
 scrollIt = ""
}

function scroll(direction,p) {
 idBox = p
 sign = "+" ;     //smir dolu (default)
 edge = (contentTop[idBox]<=0); //smir dolu (default)
 if (direction=="up"){    //podmínka pro smir nahoru
  sign = "-";
  edge = ((contentHeight[idBox]+contentTop[idBox])>=0+boxHeight[idBox]); // jestliže v krajní poloze zvoleného smiru tak nic
 }
 if (edge) scrollIt = setInterval("scrollMe()",20);
}
function scrollMe (){
 contentTop[idBox] = eval("contentTop[idBox]"+sign+"=4");
 edge = (contentTop[idBox]<=0);  //smir dolu (default)
 if (sign=="-") edge = ((contentHeight[idBox]+contentTop[idBox])>=0+boxHeight[idBox]); //podmínka pro smir nahoru
 if (edge){      // jestliže v krajní poloze zvoleného smiru tak ukoneíme cyklus
  content[idBox].style.top = (contentTop[idBox]) + "px";
 }else{
  clearInterval(scrollIt)
 }
}

function e(){
}

function Highlight(variable,color){
	variable.style.backgroundColor = color; 
}

function HighlightI(variable,image){
	variable.style.backgroundImage = image; 
}

function WriteTFlash(src,width,height){
            html = "<object type=\"application/x-shockwave-flash\" data=\""+src+"\" width=\""+width+"\" height=\""+height+"\" id=\"topicflash\" name=\"topicflash\"><param name=\"movie\" value=\""+src+"\" /><PARAM NAME=\"quality\" VALUE=\"high\"><PARAM NAME=\"wmode\" VALUE=\"transparent\"><PARAM NAME=\"bgcolor\" VALUE=\"white\"><EMBED src=\""+src+"\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#FFFFFF\"  WIDTH=\""+width+"\" HEIGHT=\""+height+"\" NAME=\"topicflash\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\" swLiveconnect=true></EMBED></object>";

            document.write(html);
	}
	
function WriteTFlash1(src,width,height,title){
            html = "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\""+width+"\" HEIGHT=\""+height+"\" id=\"headline_page\" ALIGN=\"\"><PARAM NAME=\"movie\" VALUE=\""+src+"\"><PARAM NAME=\"quality\" VALUE=\"high\"><PARAM NAME=\"wmode\" VALUE=\"transparent\"><PARAM NAME=\"bgcolor\" VALUE=\"#260743\"><PARAM NAME=\"FlashVars\" VALUE=\"nadpis="+title+"\"><EMBED src=\""+src+"\" FlashVars=\"nadpis="+title+"\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#260743\" WIDTH=\""+width+"\" HEIGHT=\""+height+"\" NAME=\"headline_page\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>";

            document.write(html);
}
