JAVASCRIPT Why is this causing an error
<p>This javascript works fine.it does what I want it to do. it puts a boarder around a table etc. but I am still getting an error in the firefox console saying that addressTable, AddressSpan AddressShort... are null or not defined. everything seems to be working but the error at the bottom of the screen is annoying I don't want to see it there</p>

<p><strong>Error</strong></p>

<blockquote>
  <p>document.getElementById("addressTable")
  is null [Break On This Error]
  document.getElementById("addressTable").style.borderStyle="solid";</p>
</blockquote>

<p><strong>Script</strong></p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
var isDroppedDown= 0 ;
function dropDown(){
        var myTable = document.getElementById("bgImgBlue");
        var sideImage = document.getElementById("sideImage");


        parent.document.getElementById('frameMain').rows = '173,*';
        isDroppedDown = 1;
        myTable.height = 100;
        sideImage.height = 100;
        document.getElementById("bgImgBlue").style.backgroundImage="url('images/i_frame_bgnavBig.gif')";
        document.getElementById("sideImage").height = 172;
        document.getElementById("addressTable").style.borderStyle="solid";
        document.getElementById("addressTable").style.borderWidth="1px";
        document.getElementById("addressSpan").style.paddingTop="";
        document.getElementById("addressShort").style.visibility = 'hidden';
        document.getElementById("ContactSpanFull").style.paddingTop="";
        document.getElementById("ContactSpan").style.paddingTop="";
        document.getElementById("ContactSpan").style.visibility = 'hidden'
        document.getElementById("contactTable").style.borderStyle="solid";
        document.getElementById("contactTable").style.borderWidth="1px";
 }

 function dropDownUp(){
        var myTable = document.getElementById("bgImgBlue");
        var sideImage = document.getElementById("sideImage");

        parent.document.getElementById('frameMain').rows = '84,*';
        isDroppedDown = 0;
        myTable.height = 84;
        sideImage.height = 160;
        document.getElementById("bgImgBlue").style.backgroundImage="url('images/i_frame_bgnav.gif')";
        document.getElementById("bgImgBlue").style.backgroundImage="url('images/i_frame_bgnav.gif')";
        document.getElementById("sideImage").height = 79;
        document.getElementById("addressTable").style.borderStyle="";
        document.getElementById("addressTable").style.borderWidth="";
        document.getElementById("addressSpan").style.paddingTop="30px";
        document.getElementById("addressShort").style.visibility = 'visible';
        document.getElementById("ContactSpan").style.visibility = 'visible'
        document.getElementById("ContactSpanFull").style.paddingTop="30px";
        document.getElementById("contactTable").style.borderWidth="0px";
 }

function dropdownResize(){

    if(isDroppedDown == 0){     
        dropDown();
    }
    else{
        dropDownUp();
        }
}


&lt;/script&gt;
</code></pre>
