/* This notice must be untouched at all times.

Copyright (c) 2005-2009 JC Arcaz. All rights reserved.
OPEN OPENBEXI htmlbuilder library for generating dynanic HTML page and html code source from browsers.
updated: March  18  2009 version 2.2
The latest version is available at http://www.openbexi.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Note:
OPEN OPENBEXI htmlbuilder uses ActiveWidgets Grid 1.0.0 (GNU General Public License).
OPEN OPENBEXI htmlbuilder uses FCKeditor 2.3 (GNU General Public License).
OPEN OPENBEXI htmlbuilder uses the DHTML libraries from www.walterzorn.com for resizing and dragging pictures and layers (LGPL).
*/
function ob_CSS_style(widget, type, css) {
    var lang = "";
    var privateDoc = openbexi_get_documentElement(OPENBEXI_PRIVATE_CONTEXT_XML, "text/xml");
    if (privateDoc != null)
        lang = get_xml_classe_object_attribut_value(privateDoc, "bexicontext", "language", "name");
    if (lang == "") lang = "en";
    _CURRENT_OPENBEXI_LANGUAGE = lang;

    var pageDoc = openbexi_get_documentElement(OPENBEXI_PAGES_DATA_XML, "text/xml");
    var widget_id = get_xml_classe_object_attribut_value(pageDoc, "url", widget, "object.id");
    if (widget_id == "")   widget_id = widget;
    var widget_type = get_xml_classe_object_attribut_value(pageDoc, "url", widget, "object.type");
    if (widget_type == "")   widget_type = type;
    var widget_css = get_xml_classe_object_attribut_value(pageDoc, "url", widget, "CSS");
    if (widget_css == "")   widget_css = css;
    try {
        document.getElementById(widget_id).style["cssText"] = widget_css;
    } catch (e) {
    }
}

