String.prototype.trim = function ()
{ 
    return this.replace(/^\s+|\s+$/, ''); 
}

var IE_all_cache = new Object();

function IE_getElementById(id)
{
    if (IE_all_cache[id] == null)
    {
        IE_all_cache[id] = document.all[id];
    }

    return IE_all_cache[id];
}

if (document.all)
{
  if (!document.getElementById)
  {
    document.getElementById = IE_getElementById;
  }
}

function waitForDownload()
{
    if (waitingTime <= 0)
    {
        document.getElementById("wait_to_download").style.display = 'none';
        document.getElementById("download_link").style.display = 'inline';
        clearInterval(downloadTimer);
    }
    else
    {
        document.getElementById("remaining_secs").innerHTML = waitingTime;
    }

    waitingTime --;
}

if (window.parent != window)
{
    window.parent.location = window.location;
}
