function popup(url, wnd_name, width, height, scrollbars)
{
   var stScrollBar = (scrollbars ? 'yes' : 'no');
   window.open(url, '', 'width='+width+', height='+height+', status=yes, menubar=no, resizable=yes, scrollbars='+stScrollBar+', left='+String((screen.width-width)/2)+', top='+String((screen.height-height)/2));
}

var htmlWnd;
function popupHtml(url, width, height, title)
{
   htmlWnd = window.open('', '', 'width='+width+', height='+height+', status=no, menubar=no, resizable=no, scrollbars=no, left='+String((screen.width-width)/2)+', top='+String((screen.height-height)/2));

   htmlWnd.document.writeln("<html>");
   htmlWnd.document.writeln("<title>" + title + "</title>");
   htmlWnd.document.writeln('<body topmargin="0" leftmargin="0">');
   htmlWnd.document.writeln('<a href="#" onclick="window.close();"><img src="' + url + '" width="'+width+'" height="'+height+'" border="0"></a>');
   htmlWnd.document.writeln("</body>");
   htmlWnd.document.writeln("</html>");
}

$(function(){
    $(".error_on_site").click(function(){

      $.ajax({
         url: '/request/mistake/',
         success: function(data) {
            $('#modal_inner_block').html(data);

            $(".modal_fon").show().height($("body").height()+71);
            $(".modal_window").show().css("top", ($(window).height()-$(".modal_window").height())/2+$(window).scrollTop());
            $(".modal_window").show().css("left", ($(window).width()-$(".modal_window").width())/2+$(window).scrollLeft());
         }
      });

        return false;
    });

   $("#preloader-wrap").ajaxStart(function(){
       $(this).show().find(".preloader").height($("body").height()+71);
   });

   $("#preloader-wrap").ajaxStop(function() {
       $(this).hide();
   });
});
