// JavaScript Document
                	$(document).ready(function() {
                            $('.dashboard-container').tabs({ fxFade: true, fxSpeed: 'fast' });
                            $("#primary").height($(window).height() - 164);
                            $("#secondary").height($(window).height() - 199);
                            $("#container").height($(window).height() - 309);
                            $("#overlay").height($(document).height());
                            $("#search").css("color", "#878e92");
                            $("#search").val("Hledaný text");
                            $(".dialog").center();
                            showElement('navigation', ['properties']);
                            $("#dialog_search_open").click(function(){
                               $('#overlay').fadeIn('fast');
                               $('.dialog-alert').fadeIn('fast');
                            });
                            $("#dialog_info_open").click(function(){
                               $('#overlay').fadeIn('fast');
                               $('.dialog-info').fadeIn('fast');
                            });
                            $("#dashboard_open").click(function(){
                               $('#overlay').fadeIn('fast');
                               $('.dashboard').fadeIn('fast');
                            });
                            $("#insert_picture").click(function(){
                               $('#overlay').fadeIn('fast');
                               $('.insert-picture').fadeIn('fast');
                            });
                            $("#dialog_question_open").click(function(){
                               $('#overlay').fadeIn('fast');
                               $('.dialog-question').fadeIn('fast');
                            });


                        });





                            $("#search").click(function(){
                                    $("#search").val("");
                                    $("#search").css("color", "#000");
                                });
                            $(window).resize(function(){
                                $("#primary").height($(window).height() - 164);
                                $("#secondary").height($(window).height() - 199);
                                $("#container").height($(window).height() - 309);
                                $(".dialog").center();
                                $("#overlay").height($(document).height());
			});



                        $(function(){
                                $('#overlay').click(function(){
                                    $('#overlay').fadeOut('fast');
                                    $('.dialog').fadeOut('fast');
                                });
                                $('.dialog-close').click(function(){
                                    $('#overlay').fadeOut('fast');
                                    $('.dialog').fadeOut('fast');
                                });
                                $(".btn_cancel").click(function(){
                                    $('#overlay').fadeOut('fast');
                                    $('.dialog').fadeOut('fast');
                                });


				// Dialog Link




                        });


jQuery.fn.center = function () {
    this.css("position","absolute");
    //this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
    //this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
    this.css("left", "50%");
    this.css("top", "50%");
    this.css("margin-left", "-" + this.width()/2 + "px");
    this.css("margin-top", "-" + this.height()/2 + "px");
    return this;
}
