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.");
	}
}

var offset = 1;
var count = 0;
var maxCount = 150;
var direction = 1;
var id = null;
var elem = null;
function jobsStart(){
	id = setTimeout("jobsScroll()", 8000);
	elem = document.getElementById("jobs-lst");
}
function jobsScroll(){
	elem.scrollTop = elem.scrollTop + (offset * direction);
	count++;
	if (count >= maxCount){
		count = 0;
		direction = -1 * direction;
		id = setTimeout("jobsScroll()", 5000);
	} else {
		id = setTimeout("jobsScroll()", 1);
	}
}
function jobsSleep(a){
	if (a) {
		window.clearTimeout(id);
	} else {
		id = window.setTimeout("jobsScroll()", 1);
	}
}

function gen_ico(im,ia,it) {
	var i = new Image()
	i.src = "imgserver"+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;
	}
}
