You don't appear to have an element in the document with id [font=monospace]mainControl[/font], so [font=monospace]document.getElementById("mainControl")[/font] will return null. You don't have any elements with a class of [font=monospace]mainControl[/font] either, so [font=monospace]document.getElementsByClassName("mainControl")[/font] won't have anything to return either (and if it did, they'd be in an array, which won't have a [font=monospace]style[/font] even so.)
Every time I hear about w3schools it's because of something wrong with it...