
var onloadFunction = function()
{
    var form = document.getElementById("signupform"),
        field = document.getElementById("signupField"),
        paragraph = document.getElementById("signupforupdates");

    form.onsubmit = function()
    {
        if (!field.value)
            return false;   

        setTimeout(function()
        {
            form.parentNode.removeChild(form);
            paragraph.innerHTML = "Thanks <span id='submitter'></span>! We'll keep you up to date on Atlas announcements.";
            
            document.getElementById("submitter").appendChild(document.createTextNode(field.value));
            
            var newFrame = document.createElement("iframe");
            
            newFrame.style.visibility="hidden";
            newFrame.style.height="0px";
            newFrame.style.width="0px";
            
            newFrame.src="confirm.html";
            
            document.body.appendChild(newFrame);

        }, 100);

        return true;
    }
}

if(typeof document.addEventListener != 'undefined')
{
    window.addEventListener('load', onloadFunction, false);
}
else if(typeof window.attachEvent != 'undefined')
{
    window.attachEvent('onload', onloadFunction);
}
