function poprawWysokosc(){
    obj1=document.getElementById('tresc');
    obj2=document.getElementById('meni');
    if(obj1.clientHeight<obj2.clientHeight){
        obj1.style.height=(obj2.clientHeight+20)+"px";
    }
}
function dodajTarget(){
    var klasa=/linkNoweOkno/i;
    obj = document.getElementsByTagName('a');
    for (i=0; i<obj.length; i++) {
        val = obj[i];
        if (klasa.test(val.className)) {
            val.target="blank";
        }
    }
}
function zwrocRealWys(wys){
    out=0;
    wys=wys.substr(0,(wys.length-2));
    tmp=wys.split("\.");
    out=tmp[0]
    if(tmp[1]>500){
        out=(tmp[0]*1)+1;
    }
    return out;
}
$(document).ready(
    function(){
        var classAkt=$("ul#meni > li > .akt").attr("id");
        var meniGl=$("ul#meni");
        $("ul#meni > li > a").hover(
            function() { 
                meniGl.attr("class",this.id);
            },
            function(){}
        );
        $("ul#meni > li > span").hover(
            function() {
                meniGl.attr("class",this.id);
                $(this).parent().children("ul").show("slide");
            },
            function(){}
        );
        $("ul#meni > li").hover(function(){},
            function() {
                meniGl.attr("class",classAkt);
                if($(this).children("ul").attr("class")!='widoczne'){
                    $(this).children("ul").hide("slide");
                } 
            }
         )
        $("div.obrazekRight img.powieksz").hover(
            function(){
                var divObr=$(this).parent();
                var gdzie=divObr.offset();
                $("div#all").before('<img src="'+$(this).attr("src")+'" id="bigRight" style="left:'+(gdzie.left-divObr.width()-7)+'px; top:'+(gdzie.top+7)+'px;" />');
                $("img#bigRight").hover(function(){},
                    function(){
                        $(this).remove();
                    }
                )
            },
            function(){
            }
         );
        $("div.obrazekLeft img.powieksz").hover(
            function(){
                var divObr=$(this).parent();
                var gdzie=divObr.offset();
                $("div#all").before('<img src="'+$(this).attr("src")+'" id="bigLeft" style="left:'+(gdzie.left+7)+'px; top:'+(gdzie.top+7)+'px;" />');
                $("img#bigLeft").hover(function(){},
                    function(){
                        $(this).remove();
                    }
                )
            },
            function(){
            }
         );
    }
);
