/////////////////////////////////////////////////////////////////////
// this function repositions the scroll bar to the top of the page.
// call it from flash by using getURL('javascript:resetToTop()');
/////////////////////////////////////////////////////////////////////
function resetToTop() {
    if (self.pageYOffset)
    {
        window.scrollTo(0,0)
    }
    else if (document.documentElement && document.documentElement.scrollTop)
    {
        document.documentElement.scrollTop = 0;
    }
    else if (document.body)
    {
        document.body.scrollTop = 0;
    }

    //
}

///////////////////////////////////////////////////////////
// this function resizes the swf objects height dynamically
// call it from flash by using getURL('javascript:setHeight(target_height)');
///////////////////////////////////////////////////////////
function setHeight(targ_h)
{
    var wes1 = document.getElementById('base');
    var wes2 = document.getElementById('base2');
   
    checkSize();
   
    if(y > targ_h)
    {   
        if (wes1.height) wes1.height = y;
        if ( (wes2) && (wes2.height) ) wes2.height = y;
        curr = y;
    } else {
        if (wes1.height) wes1.height = targ_h;
        if ( (wes2) && (wes2.height) ) wes2.height = targ_h;
        curr = targ_h;
    }

}

function checkSize() {
    if (self.innerHeight) {
        y = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        y = document.documentElement.clientHeight;
    } else if (document.body) {
        y = document.body.clientHeight;
    }
}

var y = 0;
var curr = 0;

checkSize();

window.onresize = function() {
    checkSize();
    if(y >= curr)
    {
        setHeight(y);
    } else {
        //setHeight(curr);
    }
}