I have a fav.css file with class .favBg

Code CSS:
 border: 0px;
 padding: 0px;
 margin: 0px;
 width: 100%;
 position: absolute;
 background-color: #000000;
 opacity: 0.5;
 filter: Alpha(opacity:50);

Here i have made a javascript that calculates both window height and scroll height, and another function which adds both the window height and scroll height, so i got total page height.

Code JavaScript:
function pHeight()
  var pHeight = scrollHeight() + windowHeight();
  return pHeight;

what I want to do is to update the height of class .favBg with the value of pHeight(), as each page in the site are of different length. Yes, i'm trying to do 100% page height faded background, Just like in Sitepoint Marketplace's "My Shortlist".

Basically I'm doing a "My Favorites" list just like Sitepoint Marketplace's "My Shortlist".

Help greatly appreciated.