﻿//--------------------------------------------------------------------------------

function setInfo(_meld){
    var _basis = this;

    this.backgroundColor = "#fff";
    this.color = "#0f0";
    this.timeout = 10000;
    this.timer = null;
    
    this.message=_meld;
    this.divInfo=document.getElementById("info");
    
    this.colorOK = function(){ _basis.color = "#080"; }
    this.colorERR = function(){ _basis.color = "#a00"; }
    
    this.meld = function(){
                
        _basis.divInfo.innerHTML = _basis.message.replace(/ /g,"&nbsp;"); 

        _basis.divInfo.style.backgroundColor = _basis.backgroundColor;
        _basis.divInfo.style.color = _basis.color;                                                    //.color = _basis.color;
        _basis.divInfo.style.visibility = "visible";

        if ( _basis.timeout != 0 ) {
            infoTimer = window.setTimeout(_basis.reset,_basis.timeout);
        }
    }
    
    this.reset = function(){
        try{
            _basis.divInfo.innerHTML = ''
            _basis.divInfo.style.visibility="hidden";
        }catch(e){ 
            alert("info-Kontainer fehlt (div id=info)") 
        }
    }
}

/*--------------------------------------------------------------------
    HTTP-Handler erstellen
*/
function erzeugeRequest(infoTrue) {
   var handler = false;
//////    if( infoTrue ){
//////        var inf = new setInfo("SEND");
//////        inf.timeout = 1000;                          
//////        inf.meld();
//////    }
    try {
        // Handler für IE erzeugen
        handler = new ActiveXObject(
        'Microsoft.XMLHTTP');
    } catch (ex) {}
   
    // Wenn nicht erzeugt, dann für andere
    // Browser erzeugen
    if (!handler) {
        try {
            handler = new XMLHttpRequest();
        } catch (e) {}
    }

    return handler;
}

function getZufallUrl(){
    var t = new Date();
    var m = t.getMilliseconds();
    return m;
}

