// zde je javascript, ktery by mohl byt pouzit na vsech strankach

function showMenu(id_div, cl){
    try{
        document.getElementById(id_div).className = cl;
    }
    catch(e){
    
    }
}                                                                 
function hideMenu(id_div){
    try{
        document.getElementById(id_div).className = 'none';
    }
    catch(e){
    
    }
}

function ShowHideDiv(){
    try{
        var ShowHideDiv = document.getElementById('ShowHideDiv');
        if (ShowHideDiv.style.display == 'block'){
            ShowHideDiv.style.display = 'none';
            
        }
        else {
            ShowHideDiv.style.display = 'block';
            document.getElementById('ShowHideButton').style.display = 'none';
        }
    }
    catch(ex){}
}

var onLoadFunctions = {};

onLoadFunctions.defaultActions = function(){
    //$('#new_galery').fadeOut('fast'); 
    try{
        window_loaded();
    }
    catch(ex){}
    try{
        document.getElementById('add_button').onclick = function(){skryj('add_params')};
    }catch(ex){}
}

onLoadFunctions.ShowHideDiv = function() {
    try{                      
        document.getElementById('ShowHideButton').onclick = function(){
            ShowHideDiv();
        }
    }
    catch(ex){}
}

window.onload = function(){ 
    onLoadPage();  
}
function onLoadPage(){           
    try{      
        for (var key in onLoadFunctions){
            try{
                eval('onLoadFunctions.'+key+'();');
            }catch(ex){}  
        }
    }catch(ex){}
}
function skryj(obj_id){ // nejdriv vloz jquery.js
    obj = document.getElementById(obj_id);
    if (obj.className == "show"){      
        $('#'+obj_id).slideUp('slow', function(){obj.className = "hide"; /* complete */});
    }                                                                            
    else{                        
        $('#'+obj_id).slideDown('slow', function(){obj.className = "show";/* complete */});
    }
} 

function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle)
		var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	return y;
} 

function getSize(el, styleProp){
    var result = getStyle(el, styleProp);
    if (/px$/.test(result)) result = result.substr(0, result.length-2);
    return result;
}

function ShowAll()
{
  document.getElementById('reseni_all').style.display = '';
  document.getElementById('ShowAllButton').style.display = 'none';
  
}
