var BrowserDection = Class.create();

BrowserDection.prototype = {
    initialize: function(browser/*, messageFile*/) {
        this.browser = browser;
        //this.msgFile = messageFile;
        
        this.browserDetect();
    },
    
    browserDetect: function() {
        this.browserProb = navigator.userAgent.match(this.browser);
        
        if(this.browserProb != null) {        
            
            this.overlayDiv = document.createElement('div');
            this.overlayDiv.setAttribute('id', 'IEoverlayDiv');
            this.overlayDiv.style.cssText = 'filter:alpha(opacity=95); opacity:.95; position:absolute; left:0; top:0; background-color:#000; width:100%; padding:15px 0; height:' + document.body.scrollHeight + 'px';

            
            this.overlayTextDiv = document.createElement('div');
            this.overlayTextDiv.setAttribute('id', 'ieAlertDiv');
            this.overlayTextDiv.style.cssText = 'filter:alpha(opacity=100); opacity:1.0; position:absolute; width: 400px; background-color: #fff; margin-left:' + ((document.body.scrollWidth / 2) - 200) + 'px; top:' + ((document.body.offsetHeight / 2) - 250) + 'px';
            
            this.overlayText = document.createElement('p');
            this.overlayText.setAttribute('id', 'ieAlertText');
            this.overlayText.style.cssText = 'padding:4px';
            
            this.overlayTextDiv.appendChild(this.overlayText);
            this.overlayDiv.appendChild(this.overlayTextDiv);
            
            document.body.appendChild(this.overlayDiv);            

            this.IE = true;
            this.returnBrowser.bind(this);
        }
    },
    
    getDocumentMessage: function(file) {
        this.file = file;
    
        this.options = {
            asynchronous: false,
            method: 'get',
            onComplete: function(t) {
                $('ieAlertText').innerHTML = t.responseText;
            }
        }
        
        new Ajax.Request(this.file, this.options);
    },
    
    returnBrowser: function() {
        if(this.IE == true) {
            return true;
        } else {
            return false;
        }
    }
}