Ozein.bargraph = Class.create();
Ozein.bargraph.prototype = {
    _widthpx: 0,
    _targetNode: null,
    _targetWidth: 0,
    initialize: function(node, options) {
        this.options = options;
        this._graphEffect(node, this.options);
    },
    
    _graphEffect: function(e, node)
    {
        var barAttribute;
        var barWidth;
        var barScope;
        var divtag = $('graphdiv').getElementsByTagName('div');
        for (var i=0;divtag.length>i;i++) {
            barAttribute = divtag[i].getAttribute('ozein_graph');
            if(barAttribute) {
	            this._widthpx = 0;
	            this._targetNode = divtag[i];
	            this._targetNode.style.width = '0px';
	            this._targetWidth = barAttribute;
	            barScope = divtag[i].getAttribute('ozein_graph_scope');
	            this.zoomBar(barScope);
            }
        }
        return;
    },
    
    zoomBar: function(barScope)
    {
        var scope;
        if (barScope) {
            scope = barScope;
        }else{
            var scope = this.options.scope;
        }
        this._targetNode.style.width = (this._targetWidth * scope) + 'px';
    }
}