function processInput(input, defaultValue, action)
{
    if (!action)
    {
        action = processInput.caller.name;
    }
    if ( (action == 'onfocus') && (input.value == defaultValue) )
    {
        input.value = '';
    }
    else
    if ((action == 'onblur') && (input.value == ''))
    {
        input.value = defaultValue;
    }
}

function processCountries(container)
{
    if (container.className == 'expanded')
    {
        container.className = '';
    }
    else
    {
        container.className = 'expanded';
    }
}

function showList(link, containerId, containerToHideId)
{
    var container = document.getElementById(containerId);
    var containerToHide = document.getElementById(containerToHideId);
    var prevLink = container.parentNode.getElementsByClassName('active');
    if ((prevLink) && (prevLink[0]))
    {
        prevLink[0].className = '';
        
    }
    container.style.display = 'block';
    containerToHide.style.display = 'none';
    link.className = 'active';
}

function switchTab(tabName)
{
    tabToSwitch = document.getElementById(tabName);
    tabs = tabToSwitch.parentNode.getElementsByTagName(tabToSwitch.tagName);
    for (i=0;i<tabs.length;i++)
    {
        if (tabs[i].id != tabName)
        {
            tabs[i].style.display = 'none';
        }
    }
    tabToSwitch.style.display = 'table';
    
    tabToSwitch.parentNode.getElementsByClassName('active')[0].className = '';
}

