function imgSwitch()
{
    srcx = imgSwitch.arguments[0];
    kat = imgSwitch.arguments[1];
    
    if(imgSwitch.arguments.length==3)
    {
        switchOther = imgSwitch.arguments[2];
    }
    else
    {
        switchOther = 1;
    }
    
    
    for(i=1;i<5;i++)
    {
        IMG = document.getElementById('Theme' + i);
        IMG = IMG.getElementsByTagName('img')[0];
        
        src = IMG.getAttribute('src');
        
        if(i==kat)
        {
            switching(IMG, srcx, true);
        }
        
        if(i!=kat && src.indexOf('_rec.')==-1 && switchOther==1)
        {
            src =
                src.substr(0, src.lastIndexOf('.')) + '_rec' +
                src.substr(src.lastIndexOf('.'));
            
            switching(IMG, src);
        }
        
        if(i!=kat && src.indexOf('_rec.')!=-1 && switchOther==2)
        {
            src = src.replace('_rec.', '.');
            switching(IMG, src);
        }
    }
}

function switching(IMG, src, appear)
{
    if(IMG.getAttribute('src')!=src)
    {
        IMG.style.display = 'none';
        
        IMG.removeAttribute('src');
        IMG.setAttribute('src', src);
        
        if(appear)
        {
            Effect.Appear(IMG, {duration: 0.5});
        }
        else
        {
            IMG.style.display = 'inline';
        }
    }
}
