var smfa = 1;
var _smfu = 'korisničko ime';

function promjeniAutoLogin()
{
    if (smfa) {
        document.getElementById('smfa').style.backgroundPosition = '0 -12px';
        document.getElementById('cookielength').value = '0';
    } else {
        document.getElementById('smfa').style.backgroundPosition = '0 0';
        document.getElementById('cookielength').value = '-1';
    }

    smfa = !smfa;
}

function clearLogin () {
    if (this.value == '') {
        this.value = _smfu;
    }
}

function setupSMFLogin()
{
    if (!document.getElementById('smfu').value.length) {
        document.getElementById('smfu').value = _smfu;
    }

    YAHOO.util.Event.addListener('smfu', 'click', function () {
        if (this.value == _smfu) {
            this.value = '';
        }
    });

    YAHOO.util.Event.addListener('smfu', 'keyup', clearLogin);
    YAHOO.util.Event.addListener('smfu', 'blur', clearLogin);
    YAHOO.util.Event.addListener('smfa', 'click', promjeniAutoLogin);
}

YAHOO.util.Event.addListener(window, "load", setupSMFLogin);