function addSidebar(name, url, config_url){
if(config_url == null) config_url = "";
if((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")){
window.sidebar.addPanel(name, url, config_url);
}else{
window.alert("Váš prohlížeč nepodporuje tuto funkci. Zkuste Mozillu.");
}
}
function ow(url, name, width, height) {
var left=Math.floor((screen.width-width)/2);
var top=Math.floor((screen.height-height)/2);
newwindow=window.open(url,name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+width+',height='+height+',top='+top+',left='+left);
return false;
}
var o = 0;
var id = 0;
var pause = 5000;
function jobsStart() {
id = window.setTimeout("jobsScroll()", pause);
document.getElementById("jobs-in").style.height = Math.ceil(document.getElementById("jobs-lst").offsetHeight / 2) + 8 + "px";
}
function jobsScroll() {
if (o == 0) {
o = -1 * Math.ceil(document.getElementById("jobs-lst").offsetHeight - document.getElementById("jobs-in").offsetHeight);
} else if (o < 0) {
o = 0;
}
document.getElementById("jobs-lst").style.top = o+"px";
id = window.setTimeout("jobsScroll()", pause);
}
function jobsSleep(a) {
if (a) {
window.clearTimeout(id);
} else {
id = window.setTimeout("jobsScroll()", pause);
}
}
rormx = 10;
rormn = 1;
roimw = 18;
roimh = 18;
function gen_ico(im,ia,it) {
var i = new Image;
i.src = "http://i.iinfo.cz/p/"+im;
i.alt = ia;
i.title = it;
i.width = roimw;
i.height = roimh;
return i;
}
var Funcs = {
gEBI : function(id)
{
return document.getElementById(id);
},
gEBN : function(name)
{
return document.getElementsByName(name);
},
appC : function(parent, child)
{
return parent.appendChild(child);
},
cElm : function(elm)
{
return document.createElement(elm);
},
cTxt : function(txt)
{
return document.createTextNode(txt);
},
rmC : function(parent,child)
{
return parent.removeChild(child);
},
rmE : function(elm)
{
return elm.parentNode.removeChild(elm);
},
rmChilds : function(parent)
{
while(parent.hasChildNodes()){
parent.removeChild(parent.childNodes[0]);
}
return false;;
},
preloadImgs : function(imgsUrl)
{
for(i=0;i<imgsUrl.length;i++){
var pic = new Image();
pic.src = imgsUrl[i];
}
return true;
}
}
var xmlhttp = {
xt : null,
url : null,
_parent : null,
request : function(url,content,method,parentID)
{
if(!url || !content || !parentID){return false;}
if(!method){method = 'GET';}

var tm = new Date();
this.url = url + content + "&t=" + tm.getTime();
this._parent = Funcs.gEBI(parentID);
if(this.checkHost(url)){
this.xt = this.xt ? this.xt : this.setRequestType();
if(this.xt){
this.xt.open(method,this.url,true);
this.xt.setRequestHeader("Content-Type","text/xml;Charset=utf-8");
this.xt.onreadystatechange = function(){xmlhttp.state_changed();}
this.xt.send(null);
}
}
return true;
},
requestDOM : function()
{
var loader = Funcs.cElm("script");
loader.type = "text/javascript";
loader.src = this.url;
try{
Funcs.appC(this._parent,loader);
}catch(e){
return false;
}
},
state_changed : function()
{
if(this.xt.readyState == 4){
if(this.xt.status == 200){
eval(this.xt.responseText);
}else{
this.requestDOM();
}
}
},
setRequestType : function()
{
if(window.XMLHttpRequest){
out = new XMLHttpRequest();
}else if(window.createRequest){
out = window.createRequest();
}else{
try{
out = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
try{
out = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
return this.requestDOM();
}
}
}
return out;
},
checkHost : function()
{
var host = false;
if(this.url.indexOf('http') != -1){
host = this.url.substr(7);
if(host.indexOf('/') != -1){
host = host.substr(0,host.indexOf('/'));
}
if(document.location.hostname == host){
return true;
}else{
return false;
}
}
return true;
}
}
// name je nazev idcka elementu u ktereho se ma zobrazit/skryt obsah
// value muze nastat jen none/block
function scroll_up_down_box (name, value) {
el = document.getElementById(name);
if (el != null) {
ul = el.getElementsByTagName("ul")[0];
if (value == "none" || (!value && ul.style.display == "block")) {
// neni nic nastaveno, nebo je nastaveno zobrazeni, 
// tzn. boxik je zobrazen takze ho skryjeme
ul.style.display = "none";
el.className = "dropdown-box closed";
} else if (value == "block" || (!value && ul.style.display == "none")) {
ul.style.display = "block";
el.className = "dropdown-box open";
}
}
}
function footerPromoClick(link, id) {
if(link == undefined || id == undefined) {
return true;
}
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}else if(window.createRequest){
xmlhttp = window.createRequest();
}else{
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
return true;
}
}
}
var t = new Date();
xmlhttp.open('GET',"/click.php4?id="+id+"&t="+t.getTime(),false);
xmlhttp.setRequestHeader("Content-Type","text/xml;Charset=utf-8");
xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xmlhttp.send('');
return true;
}
