function isEmptyString(strValue)
{
    var strTestString = new String(strValue);
    if ( strValue == null || strTestString.length == 0 )
        return true;
    for (i = 0; i < strTestString.length; i++)
        if ( strTestString.charAt(i) != ' '  && strTestString.charAt(i) != '\t' &&
             strTestString.charAt(i) != '\n' && strTestString.charAt(i) != '\r' )
            return false;
    return true;
}

function swapImage(image_id, image_file)
{
    var image;

    image = document.getElementById(image_id);
    image.src = image_file;
}

function expand_collapse(id_link, id_block)
{
    var block, link;

    block = document.getElementById(id_block);
    link  = document.getElementById(id_link);
    if ( block )
    {
        if ( block.style.display != 'block' )
        {
            block.style.display = 'block';
            if ( link )
            {
                link.innerHTML = 'Кратко...';
            }
        }
        else
        {
            block.style.display = 'none';
            if ( link )
            {
                link.innerHTML = 'Подробнее...';
            }
        }
    }
}

function showPopup(id_popup)
{
    var popup;
    var i;

    for (i = 0; i < 20; i++)
    {
        popup = document.getElementById('popup' + String(i));
        if ( popup )
        {
            popup.style.display = 'none';
        }
    }
    popup = document.getElementById('popup' + String(id_popup));
    popup.style.display = 'block';
}

function hidePopup(id_popup)
{
    var popup;

    popup = document.getElementById('popup' + String(id_popup));
    popup.style.display = 'none';
}

function openWindow(url, width, height, scroll)
{
    var hWnd;

    hWnd = window.open(url,"Window","resizable=no,scrollbars=" + ( scroll == true ? "yes" : "no" ) + ",width=" + width + ",height=" + height);
}
