Need Help Switching Header Image using JAVASCRIPT
<p>I'm working on a dynamic layout for a tumblr page. So far I have successfully been able to do a time-sensitive switch for the css stylesheets but now I want to switch out the banner also. </p>

<p>I whipped up some code (javascript) to do this, but keep getting an error and don't know why. I'm also unsure about where to place the code exactly. Since this is a tumblr layout, the header is placed just below the opening  tag. So i'm not sure if I should place the javascript there or should I place it just below the  tag</p>

<p>Here is the code I come up with. It's giving me a syntax error in DW, but since i'm a newbie I have no clue what the problem is. </p>

<pre><code>    &lt;script type="text/JavaScript"&gt;
&lt;!--
function getHeader() {

 if (7 &lt;= currentTime&amp;&amp;currentTime &lt; 18) {
       document.write("&lt;h1&gt;&lt;a href="/"&gt;&lt;img src="http://itsnotch.com/tumblr/images/NotchTheGuru_VCbanner.jpg" border "0" /&gt;&lt;/a&gt;&lt;/h1&gt;");
      }

       else {
       document.write(" &lt;h1&gt;&lt;a href="/"&gt;&lt;img src="http://itsnotch.com/tumblr/images/NotchTheGuru_Banner.jpg" border "0" /&gt;&lt;/a&gt;&lt;/h1&gt;");
      }

}

getHeader();
--&gt;
&lt;/script&gt;
</code></pre>

<p>it gives me a error on the 'document.write' lines. </p>

<p>Here is the entire source code for the page to give you guys a better look at what i'm doing</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
    &lt;head&gt;


  &lt;meta name="description" content="Big Notch, Notch the Guru, Notch Blog, Notch's Blog, Word of Notch" /&gt;



        &lt;!-- DEFAULT SETTINGS --&gt;

        &lt;meta name="font:Title" content="Arial" /&gt;
        &lt;meta name="font:Body" content="Lucida Sans" /&gt;
        &lt;meta name="text:Disqus Shortname" content="" /&gt;

        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
        &lt;title&gt;{block:SearchPage}Search results for "{SearchQuery}" - {/block:SearchPage}{block:PostSummary}{PostSummary} - {/block:PostSummary}{Title}&lt;/title&gt;
        &lt;link rel="icon" href="{Favicon}"/&gt;
        &lt;link rel="alternate" type="application/rss+xml" title="RSS" href="{RSS}"/&gt;
        &lt;meta name="viewport" content="width=850"/&gt; &lt;!-- iPhone --&gt;







        &lt;!--[if lt IE 7]&gt;
            &lt;style type="text/css"&gt;
                .post div.labels {
                    right: 450px;
                }
            &lt;/style&gt;
        &lt;![endif]--&gt;



&lt;!--Google Tracker Code---&gt;

&lt;script type="text/javascript"&gt;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-19744657-4']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

&lt;/script&gt;



    &lt;/head&gt;
    &lt;body&gt;

&lt;!--SCM Music Player by Adrian Shum - http://scmplayer.asweb.info--&gt;
&lt;script type='text/javascript'&gt;&lt;!--
document.write(unescape('%3C%73%63%72%69%70%74%20%74%79%70%65%3D%22%74%65%78%74%2F%6A%61%76%61%73%63%72%69%70%74%22%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%73%63%6D%70%6C%61%79%65%72%2E%61%73%77%65%62%2E%69%6E%66%6F%2F%73%63%72%69%70%74%2E%6A%73%22%20%3E%3C%2F%73%63%72%69%70%74%3E'));
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;&lt;!--
SCMMusicPlayer.init("{'skin':'skins/cyber/skin.css','playback':{'autostart':'true','shuffle':'true','volume':'70'},'playlist':[{'title':'BattleCat Instrumental Loop','url':'http://itsnotch.com/music/BattleCat%20Instrumental(loop).mp3'},{'title':'Curren$y - Skybourne','url':'http://itsnotch.com/music/skybourne.mp3'},{'title':'Dam-Funk','url':'http://itsnotch.com/music/10_west.mp3'},{'title':'Curren$y - Flight Briefing','url':'http://itsnotch.com/music/FlightBriefing.mp3'},{'title':'B-Ducey - Let Me Be (prod.by Big Notch)','url':'http://itsnotch.com/music/Let%20me%20be.mp3'},{'title':'Vado - Council Music (looped by Big Notch)','url':'http://itsnotch.com/music/Council%20Music%20(Instrumental).mp3'},{'title':'Snoop Dogg - No Bitch','url':'http://itsnotch.com/music/No_Bitch.mp3'},{'title':'Little Brother - That Aint No Love','url':'http://itsnotch.com/music/LittleBrother.mp3'}],'placement':'bottom','showplaylist':'false'}");
//--&gt;&lt;/script&gt;
&lt;!--End of SCM Music Player script--&gt;

        &lt;div id="content"&gt;


            &lt;div id="description"&gt;
                &lt;div&gt;
                                        &lt;div id="search"&gt;
                                            &lt;form action="/search" method="get"&gt;
                                                &lt;input type="text" name="q" value="{SearchQuery}"/&gt;
                                                &lt;input type="submit" value="Search"/&gt;
                                            &lt;/form&gt;
                                        &lt;/div&gt;

                    {Description}

                    &lt;p id="nav_container"&gt;
                        &lt;a href="/archive" id="archive_link"&gt;Archive&lt;/a&gt;
                        &lt;span class="dim"&gt;/&lt;/span&gt;
                        &lt;a href="{RSS}"&gt;RSS&lt;/a&gt;
                    &lt;/p&gt;
                &lt;/div&gt;
            &lt;/div&gt;

                        {block:SearchPage}
                        &lt;div id="searchresultcount"&gt;
                            &lt;p&gt;Your search for &lt;span class="query"&gt;{SearchQuery}&lt;/span&gt; returned {SearchResultCount} result(s).&lt;/p&gt;
                        &lt;/div&gt;
                        {/block:SearchPage}

            {block:Posts}
                &lt;div class="post"&gt;
                    &lt;div class="labels"&gt;
                        {block:NewDayDate}
                            &lt;div class="date"&gt;&lt;a href="{Permalink}"&gt;{Month} {DayOfMonth}&lt;/a&gt;&lt;/div&gt;
                        {/block:NewDayDate}

                        {block:SameDayDate}
                            &lt;div class="date"&gt;&lt;a href="{Permalink}"&gt;&lt;/a&gt;&lt;/div&gt;
                        {/block:SameDayDate}   

                    &lt;/div&gt;

                    {block:Regular}
                        &lt;div class="regular"&gt;
                            {block:Title}&lt;h2&gt;&lt;a href="{Permalink}"&gt;{Title}&lt;/a&gt;&lt;/h2&gt;{/block:Title}
                            {Body}
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Regular}

                    {block:Photo}
                        &lt;div class="photo"&gt;
                            {LinkOpenTag}&lt;img src="{PhotoURL-400}" alt="{PhotoAlt}"/&gt;{LinkCloseTag}
                            {block:Caption}
                                &lt;div class="caption"&gt;{Caption}&lt;/div&gt;
                            {/block:Caption} 
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Photo}
                    {block:Quote}
                        &lt;div class="quote"&gt;
                            &lt;span class="quote"&gt;
                                &lt;big class="quote"&gt;&amp;#147;&lt;/big&gt; {Quote}
                            &lt;/span&gt;
                            {block:Source}&lt;span class="source"&gt;{Source}&lt;/span&gt;{/block:Source}
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Quote}

                    {block:Link}
                        &lt;div class="link"&gt;
                            &lt;a href="{URL}" class="link" {Target}&gt;{Name}&lt;/a&gt;
                            {block:Description}
                                &lt;span class="description"&gt;{Description}&lt;/span&gt;
                            {/block:Description}
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Link}

                    {block:Conversation}
                        &lt;div class="conversation"&gt;
                            {block:Title}&lt;h2&gt;&lt;a href="{Permalink}"&gt;{Title}&lt;/a&gt;&lt;/h2&gt;{/block:Title}
                            &lt;ul&gt;
                                {block:Lines}
                                    &lt;li&gt;
                                        {block:Label}&lt;span class="label"&gt;{Label}&lt;/span&gt;{/block:Label}
                                        {Line}
                                    &lt;/li&gt;
                                {/block:Lines}
                            &lt;/ul&gt;
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Conversation}

                    {block:Audio}
                        &lt;div class="audio"&gt;
                            {AudioPlayerGrey}
                            {block:Caption}
                                &lt;div class="caption"&gt;{Caption}&lt;/div&gt;
                            {/block:Caption}
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Audio}

                    {block:Video}
                        &lt;div class="video"&gt;
                            {Video-400}
                            {block:Caption}
                                &lt;div class="caption"&gt;{Caption}&lt;/div&gt;
                            {/block:Caption}
                        &lt;/div&gt;
&lt;div id="separator"&gt;&lt;/div&gt;  

                    {/block:Video}
                &lt;/div&gt;

                {block:IfDisqusShortname}
                    {block:Permalink}
                        &lt;div id="disqus_thread"&gt;&lt;/div&gt;
                        &lt;script type="text/javascript" src="http://disqus.com/forums/{text:Disqus Shortname}/embed.js"&gt;&lt;/script&gt;
                        &lt;noscript&gt;&lt;a href="http://{text:Disqus Shortname}.disqus.com/?url=ref"&gt;View the discussion thread.&lt;/a&gt;&lt;/noscript&gt;

                        &lt;div style="text-align: right; margin-top: 5px"&gt;
                            &lt;a href="http://disqus.com" class="dsq-brlink"&gt;blog comments powered by &lt;span class="logo-disqus"&gt;Disqus&lt;/span&gt;&lt;/a&gt;
                        &lt;/div&gt;
                    {/block:Permalink}
                {/block:IfDisqusShortname}
            {/block:Posts}

            &lt;div id="footer"&gt;
                {block:PreviousPage}
                    &lt;a href="{PreviousPage}"&gt;&amp;#171; Previous&lt;/a&gt; &amp;nbsp;&amp;nbsp;
                {/block:PreviousPage}

                {block:NextPage}
                    &lt;a href="{NextPage}"&gt;Next &amp;#187;&lt;/a&gt;
                {/block:NextPage}
            &lt;/div&gt;
        &lt;/div&gt;

        {block:IfDisqusShortname}
            &lt;script type="text/javascript"&gt;
                //&lt;![CDATA[
                (function() {
                    var links = document.getElementsByTagName('a');
                    var query = '?';
                    for(var i = 0; i &lt; links.length; i++) {
                        if(links[i].href.indexOf('#disqus_thread') &gt;= 0) {
                            query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&amp;';
                        }
                    }
                    document.write('&lt;script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/{text:Disqus Shortname}/get_num_replies.js' + query + '"&gt;&lt;/' + 'script&gt;');
                })();
                //]]&gt;
            &lt;/script&gt;
        {/block:IfDisqusShortname}

&lt;script type="text/JavaScript"&gt;
&lt;!--
function getStylesheet() {
      var currentTime = new Date().getHours();
      if (22 &lt;= currentTime&amp;&amp;currentTime &lt; 7) {
       document.write("&lt;link rel='stylesheet' href='http://itsnotch.com/tumblr/files/nighttime.css' type='text/css'&gt;");
      }
      if (7 &lt;= currentTime&amp;&amp;currentTime &lt; 18) {
       document.write("&lt;link rel='stylesheet' href='http://itsnotch.com/tumblr/files/vice.css' type='text/css'&gt;");
      }
      if (18 &lt;= currentTime&amp;&amp;currentTime &lt; 20) {
       document.write("&lt;link rel='stylesheet' href='http://itsnotch.com/tumblr/files/evening.css' type='text/css'&gt;");
      }
      if (20 &lt;= currentTime&amp;&amp;currentTime &lt; 22) {
       document.write("&lt;link rel='stylesheet' href='http://itsnotch.com/tumblr/files/dusk.css' type='text/css'&gt;");
      }

}

getStylesheet();
--&gt;
&lt;/script&gt;

&lt;noscript&gt;&lt;&lt;link rel="stylesheet" type="text/css" href="http://itsnotch.com/tumblr/files/dusk.css" /&gt;&lt;/noscript&gt;



&lt;script type="text/JavaScript"&gt;
&lt;!--
function getHeader() {

 if (7 &lt;= currentTime&amp;&amp;currentTime &lt; 18) {
       document.write("&lt;h1&gt;&lt;a href="/"&gt;&lt;img src="http://itsnotch.com/tumblr/images/NotchTheGuru_VCbanner.jpg" border "0" /&gt;&lt;/a&gt;&lt;/h1&gt;");
      }

       else {
       document.write(" &lt;h1&gt;&lt;a href="/"&gt;&lt;img src="http://itsnotch.com/tumblr/images/NotchTheGuru_Banner.jpg" border "0" /&gt;&lt;/a&gt;&lt;/h1&gt;");
      }

}

getHeader();
--&gt;
&lt;/script&gt;

    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>the header was originally posted below the '' tag</p>
