
/**
 * Gets the YUI window height
 */
function getWindowHeight()
{
    var height = 0;
    try {
        if (typeof YAHOO == "object" && YAHOO && typeof YAHOO.common.overlayManager.getActive() == "object" && YAHOO.common.overlayManager.getActive()) {
            // hack for YAHOO YUI windows
            height = YAHOO.common.overlayManager.getActive().element.clientHeight + 60;
        }
    } catch (e) {
    }

    if (height == 0) {
        try {
            jQuery(".yui-simple-dialog:visible").each(function ()
                                                      {
                                                          var thisHeight = jQuery(this).height();
                                                          if (thisHeight > height) {
                                                              height = thisHeight + 60;
                                                          }
                                                      })
        } catch (e) {
        }
    }


    try {
        if (height < document.body.clientHeight) {
            height = document.body.clientHeight;
        }
        if (height < document.body.offsetHeight) {
            height = document.body.offsetHeight;
        }
        if (height < document.body.scrollHeight) {
            height = document.body.scrollHeight;
        }
    } catch (e) {
        height = height < 400 ? 400 : height;
    }
    return height;
}

try {
    window.setInterval(function ()
                       {
                           try {
                               parent.socket.postMessage((getWindowHeight()));
                           } catch (e) {
                           }
                       }, 200);
} catch (e) {

}
