function redirectDialog(){ $("#container").prepend("
\n

\n Вы пытаетесь перейти по ссылке ведущей на внешний сайт.\n <\/p>\n

\n http://www.povarenok.ru/recipes/show/33367/\n <\/p>\n<\/div>\n"); $("#redirect-popup").dialog({ autoOpen: true, width: 400, modal: true, title: 'Переход по ссылке', buttons: { 'Перейти': function(){ window.open('http://www.povarenok.ru/recipes/show/33367/', '_blank'); $(this).dialog("close"); }, 'Отменить': function(){ $(this).dialog("close"); } } }).bind("dialogclose", function(event, ui) { $(this).remove(); }); } if(!jQuery.ui || !jQuery.ui.dialog){ $.ajax({ url: '/assets/source/jquery-ui-1.8.17.custom.js', success: function(){ redirectDialog(); } }); } else{ redirectDialog(); }