/**
 * Changes the source of an image
 *
 * $params int      id      the id of the image which source has to be changed
 * $params string img   the filename (and path) of the image
 */
function change_img(id, img)
{
    document.getElementById(id).src = img;
}


/**
 * Changes the background-color of the selected motive
 *
 * $params int      radioId                 the radio button id
 * $params string imageDivPrefix  the prefix of the image div
 * $params string imageIds              all image ids
 */
function mark_selected_motive(radioId, imageDivPrefix, imageIds)
{
    var imageIdsArray = imageIds.split("|");

    for (i = 0; i < imageIdsArray.length - 1; i++)
    {
        if (imageIdsArray[i] == document.getElementById(radioId).value)
        {
            document.getElementById(imageDivPrefix + imageIdsArray[i]).style.backgroundColor = '#222222';
        }
        else
        {
            document.getElementById(imageDivPrefix + imageIdsArray[i]).style.backgroundColor = '';
        }
    }
}
