﻿


function updateStyle(leftBGColor, rightBGColor, leftBGCss, rightBGCss){
    // update nulls
    if(leftBGColor == null) leftBGColor = "";
    if(rightBGColor == null) rightBGColor = "";
    if(leftBGCss == null) leftBGCss = "";
    if(rightBGCss == null) rightBGCss = "";
    if(leftBGColor == "" && rightBGColor == "" && leftBGCss == "" && rightBGCss == "") return;
    // get the main div
    //var parent = document.getElementById("mainDiv");
    var parent = document.body;
    if(parent != null){
        // add the left and right bg divs
        var bgDiv = document.createElement("div");
        parent.appendChild(bgDiv);
        bgDiv.className = "dynamicBGDiv";
        // todo, make this better.  for now, just use a table.
        var html = "<table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
        html += "<tr><td";
        if(leftBGColor != "") html += " bgcolor=\"" + leftBGColor + "\"";
        if(leftBGCss != ""){
            alert(leftBGCss);
            html += " style=\"background:" + leftBGCss + "\"";
        }
        html += ">&nbsp;</td><td";
        if(rightBGColor != "") html += " bgcolor=\"" + rightBGColor + "\"";
        if(rightBGCss != "") html += " style=\"background:" + rightBGCss + "\"";
        html += ">&nbsp;</td></tr></table>";
        //alert(html);
        bgDiv.innerHTML = html;
    }
}

