var Warning = new Class({
    Extends: Object,

    initialize: function(message, button, onOK) {
	var winWidth = window.getWidth();
        var winHeight = window.getHeight();
        var warningWidth = 520;
        var warningHeight = 310;
        var left = Math.floor((winWidth - warningWidth) / 2);
        var top = Math.floor((winHeight - warningHeight) / 2);

        this.el = new Element('div', {
            'class': 'warning'
    	});
        this.el.setStyles({'top': top, 'opacity': 0, 'z-index': 105}).injectInside(document.body);		// 'left' is done via CSS

        this.warningTxt = new Element('div', {
            'class': 'warningText',
            'html':  message + "\n"
        })
        .injectInside(this.el);
	
        this.alertOK = new Button('i', this.el, 'warningOK', 'b', 0, 225, button, this.cancel.bindWithEvent(this), '');
        $('warningOK').setStyle('left', (520 - $('warningOK').clientWidth) / 2);
        this.onOK = onOK;

        schmedley.fade('in', this.el);
    },
    
    cancel: function() {
        if (this.onOK) {
            this.onOK.call();
        }

        this.el.destroy();
        schmedley.blackOut('out');		// do we need this ?
    }
    
});