function addClass(item,cls){
	var oldclass=item.className;
	item.className=oldclass+' '+cls;
}

function remClass(item,cls){
 var oldclass=item.className;
 var newclass=oldclass.replace(cls,"").replace(/^\s+/, '').replace(/\s+$/, '');
 item.className=newclass;
}

function jSwap(what){
	$(what).toggle();
}

function swapSrc(id,src){
	document.getElementById(id).src=src;
}

function setDefPic(pic,src){
	document.getElementById('defPic').value=pic;
	document.getElementById('defPicImg').src=src;
}

function hide(what){
	$(what).hide();
}

function slide(what){
	$(what).slideToggle();
}

function pridatSoubor(id,soubor,nazev){
	var input="<input id='souborInput"+id+"' name='soubory[]' value='"+id+"' type='hidden'/>";
	var novy="<tr id='soubor"+id+"'><th>"+soubor+"</th><td>"+nazev+"</td><td><a href='#' onclick='odebratSoubor(\""+id+"\"); return false;'>-</a></td></tr>";
	$("#dostupny"+id).toggle();
	$("#soubory").prepend(input);
	$("#souboryList").prepend(novy);
}

function odebratSoubor(id,soubor,nazev){
	$("#souborInput"+id).remove();
	$("#soubor"+id).remove();
	$("#dostupny"+id).toggle();
}

function addInput(tgt,type,name){
	var input = "<input name='"+name+"' type='"+type+"'/><br/>";
	$(tgt).append(input);
}

function swap(hide,show){
	$(hide).hide();
	$(show).slideDown();
}

