How do you get the size of the viewable screen of the user? Using JavaScript and/or ASP.NET and/or CSS.

What I'm trying to do is resize a picture to fit the width of the window so it covers the top. I also want to have an event that when the window resizes, it resizes the picture. I have tried setting the width to 100% hoping that its 100% of the width of wherever the picture is in (the window). But no.