    $( function (){
        $(".messages:visible").hide().slideDown()
        .append("<li class='close'>X</li>").find( ".close" ).click( function () {
            $(".messages").hide( "explode", { pieces: 15}, 2000 );
        });

        $(".more").corner();
        $(".buttony li").corner();

        //flashembed( "banner_left", { src : "/site_media/banner190x300.swf" } )
        //flowplayer( ".player", "/site_media/flowplayer/flowplayer.swf", { clip:  { autoPlay: false,autoBuffering: true }});

        $("#inner-wrap").corner( "round br 15px cc:#103056" )
//        $("#inner-wrap").corner( "round tr 15px " )
        $("#inner-wrap").corner( "round bl 15px cc:#103056" )
    });

$("document").ready( function () {

	$("#lang select").change( function () {
        if( $.browser.msie ) {
            var elem = $("<a href='/lang/" + $(this).val() +"/' >&nbsp;</a>");
            elem.appendTo("body");
            elem.get(0).click();
            return true;
        }
        else {
            document.location = "/lang/" + $(this).val() + "/";
            return true;
        }
    });
});

function cycler( max ) {
    this.max = max;
    this.current = 0;

    this.next = function () {
        this.current++;

        if( this.current >= this.max )
            this.current = 0;

        return this.current;
    }
}

function get_img( imgs, nr ){
    return $( imgs.get( nr ) );
}

$( function () {
    var imgs = $("#rotate img").hide();

    var cycle = new cycler( imgs.length )

    $("#rotate").height( 200 )
    $( "#rotate img:eq(0)" ).show();

    function rotate(){
        get_img( imgs, cycle.current ).fadeOut( function (){
            get_img( imgs, cycle.next() ).fadeIn();
        });
    }
    setInterval( rotate, 3000 )
});

$(function() {
    $( "#tabs" ).tabs();

    $('#tabs').bind('tabsselect', function(event, ui) {
        var i = ui.index + 1;
        $( ".realizacje" ).hide();
        $( ".realizacje-" + i ).show();
        //ui.tab     // anchor element of the selected (clicked) tab
        //ui.panel   // element, that contains the selected/clicked tab contents
       // zero-based index of the selected (clicked) tab
    });

    $( ".tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *" )
        .removeClass( "ui-corner-all ui-corner-top" )
        .addClass( "ui-corner-bottom" );
    $(".ui-tabs-panel").removeClass("ui-corner-bottom").addClass("ui-corner-top");
    $(".ui-tabs-nav li").corner( "bottom 10px" )
});

