﻿var signInAnnoyEnabled = false;

function SigInGetUserAttention(id, color1, color2, times)
{
    if (document.getElementById(id) == null)
        return;
    
    var o = document.getElementById(id);
    if (color1 == null)
    {
        color1 = o.style.backgroundColor;
        color2 = "#AC0004";
        times = 100;
        signInAnnoyEnabled = true;
    }
    
    o.style.backgroundColor = color2;
    times--;
    o.focus();
    
    if (signInAnnoyEnabled == false)
    {
        if (times % 2 == 1)
            o.style.backgroundColor = color1; //Changes the color back if it's not currently it.
        
        return;
    }

    if (times > 0)    
        setTimeout("SigInGetUserAttention('"+id+"','"+color2+"','"+color1+"',"+times+")", 200);

}