function expandParagraph(paragraph_id, link){
    var par=document.getElementById(paragraph_id);
    var lin=document.getElementById(link);
    
    if(!par)return true;
    if(!lin)return true;

    par.style.display="block"
    lin.style.display="none"
    return true;
}

function hideParagraph(paragraph_id, link){
    var par=document.getElementById(paragraph_id);
    var lin=document.getElementById(link);
    
    if(!par)return true;
    if(!lin)return true;

    par.style.display="none"
    lin.style.display="block"
    return true;
}

function replaceImage(image_id, source){
    document.getElementById(image_id).setAttribute("src", source, 0);
    return true;
}

function highlightCell(cell_id){
    var normal_color=document.getElementById(cell_id).style.backgroundColor;
    document.getElementById(cell_id).setAttribute("normal_color", normal_color, 0);

    document.getElementById(cell_id).style.backgroundColor = "#DDDDDD";
//    document.getElementById(cell_id).style.padding = "0px";
//    document.getElementById(cell_id).style.border = "solid 0 #17375E";
//    document.getElementById(cell_id).style.borderWidth = "1px";
    
    return true;
}

function unhighlightCell(cell_id){
    var normal_color=document.getElementById(cell_id).getAttribute("normal_color", 0);

    document.getElementById(cell_id).style.backgroundColor = normal_color;

//    document.getElementById(cell_id).style.padding = "1px";
//    document.getElementById(cell_id).style.borderWidth = "0px";

    return true;
}


function activatedImage(image){
    var imsrc = document.getElementById(image).getAttribute("src", 0);
    if (imsrc.search(/.png/g) != -1) {
        imsrc = imsrc.replace(/.png/g, "_selected.png");
    }
    
    document.getElementById(image).setAttribute("src", imsrc, 0);
        
    return true;
}

function deactivatedImage(image){
    var imsrc = document.getElementById(image).getAttribute("src", 0);
    if (imsrc.search(/_selected.png/g) != -1) {
        imsrc = imsrc.replace(/_selected.png/g, ".png");
    }

    document.getElementById(image).setAttribute("src", imsrc, 0);
        
    return true;
}

