$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='gal']").colorbox({opacity:"0.6", initialWidth:"100", initialHeight:"100"});
			});

// Fancybox nastavení
// $(document).ready(function() {
// 	$("a.group").fancybox({
// 		'zoomSpeedIn':		300, 
// 		'zoomSpeedOut':	300,
// 		'overlayOpacity':	0.4 
// 	});
// });

function resetInputs(ids)
{
    for(i in ids) {
        document.getElementById(ids[i]).value = 0;
    }
}
function resetAll(formid)
{
    form = document.getElementById(formid);
    for(i in form.getElementsByTagName("select")) {
        if(form[i] != null) {
            form[i].value = 0;
        }
    }
}
version = navigator.appVersion.toLowerCase();
ie = (version.indexOf('msie')>-1);
subsVisible = [];
timer = false;
timer2 = false;
milisec = 500;
function subShow(subId)
{
    list = document.getElementById('navi-list');
    submenus = list.getElementsByTagName('ul');
    for(i in submenus) {
        if(submenus[i].id) {
            if(submenus[i].id == subId) {
                elm = document.getElementById(subId);
                if(timer) {
                    clearTimeout(timer);
                    clearTimeout(timer2);
                }
                if(elm && !subsVisible[subId]) {
                    elm.style.display = "block";
                    subsVisible[subId] = true;
                    selectsVisibility('hidden');
                }
            }
            else {
                subHide(submenus[i].id);
            }
        }
    }
}
function subWannaHide(subId)
{
    elm = document.getElementById(subId);
    if(elm && subsVisible[subId]) {
        timer = setTimeout("subHide(\""+subId+"\")", milisec);
        timer2 = setTimeout("selectsVisibility('visible')", milisec);
    }
}
function subHide(subId)
{
    elm = document.getElementById(subId);
    if(elm && subsVisible[subId]) {
        elm.style.display = "none";
        subsVisible[subId] = false;
    }
}
function selectsVisibility(vis)
{
    if(!ie) {
        return;
    }
    form = document.getElementById('filter-form');
    if(!form) {
        return;
    }
    selects = form.getElementsByTagName('select');
    for(s in selects) {
        if(selects[s].id) {
            sel = document.getElementById(selects[s].id);
            sel.style.visibility = vis;
        }
    }
}
    
function menuClick(parentid, over)
{
    timer = setTimeout("menuClickNow(\""+parentid+"\", \""+over+"\")", 1);
}
function menuClickNow(parentid, over)
{
    
    listid = 'menu-parentid-'+parentid;
    buttonid = 'a-parentid-'+parentid;
    filterid = 'filter-parentid-'+parentid;
        
    list = document.getElementById(listid);
    button = document.getElementById(buttonid);
    filter = document.getElementById(filterid);

    if((button.className == 'tree closed') || (over == 1)) {
        button.className = 'tree open'
        if(list) {
            list.style.display = "block";
        }
        if(filter) {
            filter.style.display = "block";
        }
    }
    else {
        button.className = 'tree closed'
        if(list) {
            list.style.display = "none";
        }
        if(filter) {
            filter.style.display = "none";
        }
    }
}
function menuReset()
{
    var count = 0;
    elm = document.getElementById('menu-parentid-0');
    for(i in elm.getElementsByTagName("li")) {
        count = count + 1;
        if(elm[i] != null) {
            elm[i].style.background = 'red';
        }
    }
//alert(count);
}
	
function MM_findObj(n, d) { //v4.01
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
    }
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
        if ((x=MM_findObj(a[i]))!=null){
            document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
        }
}
function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
    var d=document; if(d.images){
        if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){
                d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
            }
            }
}

function printContent(nameOfElement,windowName){
    newWindow = window.open("", "", "width=800, height=800, scrollbars=yes");

    newWindow.document.write('<head><title>'+windowName+'</title></head><div class="'+nameOfElement+'">');

    element = document.getElementById(nameOfElement);

    divElements = element.getElementsByTagName("div");

    for(var c=0; c < divElements.length; c++) {

        if(divElements[c].className.search("printable") > -1)newWindow.document.write('<div class="'+ divElements[c].className +'">'+divElements[c].innerHTML+'</div>');
    }


    newWindow.document.write('</div>');

    newWindow.print();

}
