//function to change background color for Elements (table, Div, etc...)
function SetElementBG(ElementName,ElementColor){
if((document.getElementById)&& (document.getElementById(ElementName) != null)) {
// Get a reference to the element
var Element = document.getElementById(ElementName);
// Check the element's style object and background property are available
if ((Element.style)&& (Element.style.backgroundColor != null)) {
// change style to default color
document.getElementById(ElementName).style.backgroundColor = ElementColor; }
}else {
return;
}} 

//change background color
function SetBG(theColor){document.bgColor=theColor;}
//-----------------------------------------------------------------------------------------------------------

//Change the right side color of the page
function SetRightPageColor(theColor){SetBG(theColor);}
//change the color of the center of the page Or body
function SetCenterPageColor(theColor){
SetElementBG("CenterPage",theColor);
SetElementBG("CenterB1Page",theColor);
SetElementBG("CenterB2Page",theColor);
}
//Change the color of the Left side of the page 
function SetLeftPageColor(theColor){
SetElementBG("LeftPage",theColor);
SetElementBG("LeftB1Page",theColor);
}

function SaveSettings(Changes){
DeleteCookie("PageColors");
SetCookie("PageColors",Changes,expires,SitePath);
location.reload();
}