Simply use the function below:
// Shows or hides a certain field
function HandleField(field, display) {
document.getElementById(field+”_c”).style.display = display;
document.getElementById(field+”_d”).style.display = display;
}
/* Calling */
HandleField(“fieldid”, “inline”); // show inline
HandleField(“fieldid”, “block”); // show block
HandleField(“fieldid”, “none”); // hide