/**
* UTIL FUNCTIONS
*
*
*/


$(document).ready(function(data)
{
	$("#menu-auth .submenu, #loginbox, #content .galleries .gallery, #content .gallery-list .image").hover(function() {
            $(this).addClass("sfhover");
        }, function(){
            $(this).removeClass("sfhover");
    });
});

/**
*Load all tags in db
*/
function loadAllTagsAsArray(callback){	
	tags=[];
	all_tags=new Array();	
	$.getJSON('/get_all_tag_names', function(data) {
		var i=0;
		$.each(data, function(key, val) {			
			text=val.replace(/[_-]/g," ");
			tags[i]=text
			all_tags[key]=text;
			i++;			
  		});
		callback(tags,all_tags);
	});
}

/**
*Adress to static stuf
*/
function get_static_url(){return "http://medusa.fit.vutbr.cz/itsstatic/";}

/**
*Function creates rotation progress bar HTML element
*/
function create_progress_element(id,style){
	img=document.createElement('img');
	img.setAttribute("src",get_static_url()+"img/ajax-loader.gif");
	img.setAttribute("style",style);
	img.setAttribute("id",id);
	return img;
}


/**
*Function hides HTML element by ID
*/
function hideElement(id){
	var elem = document.getElementById(id);
	elem.hide();
}

/**
*Function hides HTML element by ID
*/
function removeElement(id,rootElement){
	//$(rootElement).
}
