Actionscript not working

hi
I am using this script to change image by hour.

_root.onLoad = function() {

if ((hours >= 5) && ( hours <= 6))
{
trace (“Dawn”);
gotoAndPlay(2);
}

else if( (hours >= 7) && ( hours <= 17) )
{
trace (“Day”)
gotoAndPlay(40);
}

else if( (hours >= 6) && ( hours <= 19) )
{
trace (“Dusk”)
gotoAndPlay(2);
}

else{
trace (“Night”)
gotoAndPlay(78);
}
}

this is working properly on the Safari but not in Firefox and IE.

Can some one please help me? Its real emergency.

Tanks