title: document.write creates content out of the required div container in opera and msie
body: <p>I have an ad code that I am embedding in a div and then i am wrapping them all within a document.write. When I output it on a page, div remains in it's position but contents of ad code are created elsewhere i.e bottom left corner of page. Previously i had posted wrong code, here's the working code:</p>
  
  <pre><code>    &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"&gt;  
  &lt;/script&gt;
  &lt;style&gt;
  #pubToolbar{
      margin-left: 20%;
      width:700px;
      height: 90px;
      border: 2px solid #888;
      visibility: hidden;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="pubToolbar"&gt;
  &lt;script type="text/javascript"&gt;
  document.write("&lt;div align=\"center\" id=\"pubToolbar_banner\" style=\"width:728px;height:90px;margin:0px auto;z-index:9999;margin-left:72px;display:block;bottom:-120px;position:relative;border:2px solid #999\" class=\"cpa-campaign-white\"&gt;\n"); 
  var section=3901;
  var width=728;
  var height=90;
  var enc=1;
  var clicktag="http%3A//adserver.adtechus.com/adlink%2F5359%2F2132703%2F0%2F2237%2FAdId%3D2384320%3BBnId%3D1%3Bitime%3D542661387%3Blink%3D";
  var pop=0;
  document.write("&lt;scr"+"ipt type=\"text/javascript\" src=\"http://cdn.atomex.net/static/js/ads-min.js\"&gt;\n");
  document.write("&lt;/scr"+"ipt&gt;\n");
  document.write("&lt;noscript&gt;&lt;iframe src=\"http://ads.atomex.net/cgi-bin/adserver.fcgi/ad?section=3901&amp;width=728&amp;height=90&amp;enc=1&amp;type=iframe&amp;js=0&amp;clickTag=http://adserver.adtechus.com/adlink/5359/2132703/0/2237/AdId=2384320;BnId=1;itime=542661387;nodecode=yes;link=http%3A//adserver.adtechus.com/adlink%2F5359%2F2132703%2F0%2F2237%2FAdId%3D2384320%3BBnId%3D1%3Bitime%3D542661387%3Blink%3D\" height=\"90\" width=\"728\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" &gt;&lt;/iframe&gt;&lt;/noscript&gt;\n");
  document.write("\n");
  document.write("\n");
  document.write("\n");
  document.write("\n");
  document.write("&lt;/div&gt;\n");
  var adcount_2132703_1_=new Image();
  adcount_2132703_1_.src="http://adserver.adtechus.com/adcount/3.0/5359/2132703/0/2237/AdId=2384320;BnId=1;ct=3358222966;st=1276;adcid=1;itime=542661387;reqtype=5;";
  // 034665b732c4e8a5a7992aeb7377c4b8
  &lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $('#pubToolbar_banner').css('display','block');
      $('#pubToolbar').css('visibility','visible');
      $('#pubToolbar').animate({bottom:0},1500,'swing');
  &lt;/script&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The code within div is the code from an ad server named adtech. Now this is all within a wrapper div. Note, in this code, in first div of document.write I have given to the main wrapper 'visibility:none', to hide it initially on older browser.(Suggestion from Perry Tew). </p>
  
  <p>But when I turn it's visibility on, banner ad is rendered outside wrapper div. Thus is experienced on IE-6/7/8 and old versions of opera i.e 11.20 and older.</p>