--> $(function() { $('div#xFileUpload a').click(function(e) { e.preventDefault(); var $this = $(this); var index = $(this).index(); // alert(index); var horizontalPadding = 350; var verticalPadding = 150; $('') .dialog({ title: ($this.attr('title')) ? $this.attr('title') : 'External Site', autoOpen: true, width:$(document).width()-horizontalPadding+30, height: $(document).height(), modal: true, resizable: true, autoResize: true, position: { my: 'center', at: 'top', collision: 'fit', // ensure that the titlebar is never outside the document using: function(pos) { var topOffset = $(this).css(pos).offset().top; if (topOffset < 0) { $(this).css('top', pos.top - topOffset); } } }, buttons: { "저장": function() { $('div#xFileUpload *').eq(index-1).val($("#filelink",window.frames.externalSite.document).attr("href")); $( this ).dialog( "close" ); }, "닫기": function() { $( this ).dialog( "close" ); //alert(top); } }, overlay: { opacity: 0.5, background: "black" } }) .width($(document).width()- horizontalPadding).height($(document).height() - verticalPadding); }); });