dialog position .obajnequa

dialog position .obajnequa

Hello,

I using jquery-ui 1.8, jquery 1.4

I meet the strange problem: on the some pages .dialog('option','position',[left,right]); does not work,
The code for dialog generation almost the same, js console not report any error, but if i change 'position' option it drop dialog to left-top postion (even if i pass  real coordinates [400,400] for example). 

The code is like the following:
  1. $j=jQuery.noConflict();
  2. d_id=gen_id(); //return 'Dialog_444_555_45' for example
  3. text="test';
  4. text="<div id='"+d_id+"'>"+text+"</div>";
  5. $j('body').append(text);
  6. $j('#'+d_id).ready(function() {
  7.  $j('#'+d_id).dialog({width:"auto",height:"auto",modal:false, close: function(event, ui) {$j(this).remove();} });

  8.  $j('#'+d_id).dialog( "option", "title","some title");
  9.  if ($j('#'+d_id).width()>700) {$j('#'+d_id).dialog( "option", "width",700);}
  10.  if ($j('#'+d_id).height()>300) {$j('#'+d_id).dialog( "option", "height",300);}
  11.  $j('#'+d_id).dialog( "option", "position",[500,500]);
  12. });


the problem that same code works fine on other page, i not sure, may be it think that window size is 0, but I not understand why.
After dialog is already created, i also can't control it from javascript console, i.e. if i pass it position it jump to top-left, but if i drag it over the screen it setup good coordinates in own position option. 

ps: sorry for random string in name, just to not conflict with other posts.