Codice PHP:
<body>

<
SCRIPT language="javascript">

function 
changeColor(newColor){
document.write(newColor);

document.getElementById("subBodyMap").style.background newColor;
document.getElementById("subMenuBarMap").style.background newColor;
document.getElementById("hid1").value newColor ;

}
</Script>

<form method=POST > 
<input type="button" name="cmd1" style="background-color:#0000FF; height:10px; width:10px; border:none" onClick="changeColor('0000FF')">
<input type="button" name="cmd1" style="background-color:#FF0000; height:10px; width:10px; border:none" onClick="changeColor('FF0000')">
<input type="hidden" name="hid1" id="hid1" >
</form>

</body> 
cosi hai il tuo valore in un hidden al prossimo file fai interttare il valore con
$colore = $_POST["hid1"];

e vai avanti cosi... da qui puoi anche decidere se metterlo in session oppure no, vedi tu.
Io qui ti ho dato una sostanziosa mano, per il resto devi fare tu...