
function insertNewCategortyOption(obj) {
	var prevRow, tr, th, td, select, option;	
	
	select = document.createElement('select');
	select.name = 'personalVideoCategory[]';
	
	option = document.createElement('option');
	option.value = 0;
	option.appendChild(document.createTextNode('--- Vyberte kategorii ---'));
	select.appendChild(option);
	
	for(var i = 0; i < privateCategories.length; i++) {
		option = document.createElement('option');
		option.value = privateCategories[i].IDgallery;
		option.appendChild(document.createTextNode(privateCategories[i].name));
		
		select.appendChild(option);
	}
	
	tr = document.createElement('tr');
	th = document.createElement('th');
	td = document.createElement('td');
	
	th.appendChild(document.createTextNode('Další kategorie'));
	
	td.appendChild(select);
	tr.appendChild(th);
	tr.appendChild(td);
	
	$(obj).parents('tbody')[0].insertBefore(tr, $(obj).parents('tr')[0]);
}
