Hello everyone, I'm a newbie to javascript, and would absolutely love if someone could help me understand why it's returning that document.getElementById("footer") is null. What I need this to do is to add the appropriate class to the element with id="footer".

This is a php document in order to render only specific javascript depending on a variable from a cookie. If you view the link to the full script below, Everything but the problem area is working.


PHP Code:
#Check to see if cookie has been set
#If it has, set $isExtended var to Cookie var
$isExtended $_COOKIE['isExtended'];
#and echo current value
echo "isExtended = $isExtended ;";
#and set element's rendered class
[COLOR="Red"]if($isExtended == 0
        else {
#If it hasn't, echo default value

"isExtended = 1 ;";

Here is the link I'm working on: http://blog.blindmikey.com
And here is a direct link to the full script: http://blog.blindmikey.com/wp-conten...oterToggle.php

Thank you to anyone that can explain this to me, sad to admit, I've spent hours on this.