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


                        });





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



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


				// 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");
    return this;
}
