title: I am getting "Object Required" error message
body: <p>I am trying to stick a news scroller on the home page of our website.</p>
  
  <p>I am a bit confused by the error message I am getting because I get it on one PC but not on another:</p>
  
  <blockquote>
    <p>Object Required</p>
  </blockquote>
  
  <p>I am using the below code but the following line keeps throwing <code>Object Required</code> error when I use this file as a web user control on my <code>default.aspx page</code>:</p>
  
  <pre><code>el2.style.height='&lt;%=box_height %&gt;';
  </code></pre>
  
  <p>As a result, the news is not scrolling.</p>
  
  <p>Any help greatly appreciated.</p>
  
  <pre><code>&lt;a href="#"&gt;&lt;uc1:NewsScroller ID="NewsScroller1" runat="server" /&gt;&lt;/a&gt;
  
  &lt;script language="VB" runat="server"&gt;
      Public box_TextColor As String = "black"
      Public box_height As Integer = 150
      Public box_width As Integer = 166
      Public box_padding As String = "0 0 0 20"    
  &lt;/script&gt;
  
  &lt;script type="text/javascript" for="window" event="onload"&gt;
  // &lt;!CDATA[
      return window_onload()
  // ]]&gt;
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  // &lt;!CDATA[
  
  // &lt;!--
      var speed = 2;
      function init(){
          var el = document.getElementById("newsdiv");
          el.style.overflow = 'hidden';
          el.style.height='&lt;%=box_height %&gt;';
          el.style.width='&lt;%=box_width %&gt;';
          el.style.padding='&lt;%=box_padding %&gt;';
          el.style.color='&lt;%=box_TextColor %&gt;';
  
          var el2 = document.getElementById("newsdiv-p1");
          el2.style.height='&lt;%=box_height %&gt;';
          var el3 = document.getElementById("newsdiv-p2");
  
          el3.style.height='&lt;%=box_height %&gt;';  
          //alert(document.getElementById("newsdiv-p2").style.height+document.getElementById("newsdiv-p2").style.height);
          scrollFromBottom();  
      }
  
      var go = 0;
      var timeout = '';
      function scrollFromBottom(){
  
          clearTimeout(timeout);
          var el = document.getElementById("newsdiv");
          if(el.scrollTop &gt;= el.scrollHeight-'&lt;%=box_height %&gt;'){
              el.scrollTop = 0;
          };
  
          el.scrollTop = el.scrollTop + speed;
          if(go == 0){
              timeout = setTimeout("scrollFromBottom()",50);
          };
      }
  
      function stop(){
          go = 1;
     }
  
     function startit(){
         go = 0;
        scrollFromBottom();
      }
  // --&gt;
  
      function window_onload() {
      init();
  
  }
  // ]]&gt;
  &lt;/script&gt;
  
  
  &lt;%--&lt;asp:Panel ID="newsdiv" runat="server" onmouseout="startit();" onmouseover="stop();"&gt;--%&gt;
      &lt;div id="newsdiv"  onmouseout="startit();" onmouseover="stop();"  &gt;
          &lt;p id="newsdiv-p1" class="spacer"&gt;&lt;/p&gt;
          &lt;asp:Label ID="lblNews" runat="server" Text="News..."&gt;&lt;/asp:Label&gt;
          &lt;p id="newsdiv-p2" class="spacer"&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;%--&lt;/asp:Panel&gt;--%&gt;
  </code></pre>
  
  <p>@Marcel, I suppose you mean the source (right-click, view source and copy the code)?</p>
  
  <p>If so, here it is and again, thanks</p>
  
  <pre><code>    &lt;script type="text/javascript" for="window" event="onload"&gt;
  // &lt;!CDATA[
  return window_onload()
  // ]]&gt;
  &lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  // &lt;!CDATA[
  
  // &lt;!--
  var speed = 2;
  
  $(document).ready(function init(){
    var el = document.getElementById("newsdiv");
    el.style.overflow = 'hidden';
    el.style.height='150';
    el.style.width='166';
     el.style.padding='0 0 0 20';
     el.style.color='black';
  
  var el2 = document.getElementById("newsdiv-p1");
  
    el2.style.height='150';
  var el3 = document.getElementById("newsdiv-p2");
  
    el3.style.height='150';  
    //alert(document.getElementById("newsdiv-p2").style.height+document.getElementById("newsdiv-p2").style.height);
    scrollFromBottom();
  
  
   }); 
  var go = 0;
  var timeout = '';
  function scrollFromBottom(){
  
    clearTimeout(timeout);
    var el = document.getElementById("newsdiv");
    if(el.scrollTop &gt;= el.scrollHeight-'150'){
      el.scrollTop = 0;
  
    };
    el.scrollTop = el.scrollTop + speed;
    if(go == 0){
      timeout = setTimeout("scrollFromBottom()",60);
    };
  }
  
  function stop(){
    go = 1;
  }
  
  function startit(){
    go = 0;
    scrollFromBottom();
  }
  // --&gt;
  
  function window_onload() {
  init();
  
  }
  
  // ]]&gt;
  &lt;/script&gt;
  &lt;div id="newsdiv"  onmouseout="startit();" onmouseover="stop();"  &gt;
  &lt;p id="newsdiv-p1" class="spacer"&gt;
      &lt;/p&gt;
      &lt;span id="NewsScroller1_lblNews"&gt;&lt;a href='#' OnClick=javascript:window.open('newsDetail.aspx?NewsID=10','NewsDetail','width=800,height=600;toolbar=no;');&gt;&lt;font face='verdana' size='2' color='#184D68'&gt;Steve's Birthday&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;a href='#' OnClick=javascript:window.open('newsDetail.aspx?NewsID=15','NewsDetail','width=800,height=600;toolbar=no;');&gt;&lt;font face='verdana' size='2' color='#184D68'&gt;Our Anniversary&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;a href='#' OnClick=javascript:window.open('newsDetail.aspx?NewsID=14','NewsDetail','width=800,height=600;toolbar=no;');&gt;&lt;font face='verdana' size='2' color='#184D68'&gt;Jessie's Birthday&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;
      &lt;p id="newsdiv-p2" class="spacer"&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I am still trying to wrap my head on how this great forum works. Yesterday, I was able to see a button that says, "Add comment". Since today, I have not been able to see it. I guess my question is, how do you log back in so you are able to add comments, etc? Login appears to be cookie-driven which means that your priviledges disappear once you close the browser, no?</p>