﻿function toggleLogin(context)
{
    document.getElementById(context + '_divLoginOn').style.display = '';
    document.getElementById(context + '_divLoginOff').style.display = 'none';
    return false;
}

function initializeMaxLength(txtAreaID, spanID, maxLength)
{
    var txtArea = document.getElementById(txtAreaID);
    var span = document.getElementById(spanID);
    
    if (txtArea && span)
    {
        txtArea.span = span;
        txtArea.maxLen = maxLength;
        txtArea.onkeyup = checkMaxLength;
        txtArea.onchange = checkMaxLength;
    }
}
    
function checkMaxLength() 
{
    var currentLength = this.value.length;
    if (currentLength > this.maxLen)
    {
        this.span.className = 'red';
    }
    else
    {
        this.span.className = '';
    }
    this.span.firstChild.nodeValue = currentLength;
}