function IcftMessage() {};
//{
    IcftMessage.Inicia = function(controleid, arquivocss) {
        var controle = $(controleid);
        if (arquivocss != undefined)
            controle.arquivocss = arquivocss;

        var ret = "<html><head>";
        if (controle.arquivocss!=undefined)
            ret += "<link rel='stylesheet' type='text/css' href='"+controle.arquivocss+"' />";
        ret += "</head><body style='overflow:hidden'></body></html>";
        
        return ret;    
    }

    IcftMessage.Define = function(controleid) {
        var controle = $(controleid);
        var contdoc = controle.contentWindow.document;
        contdoc.body.innerHTML = $(controle.id+"_MsgDiv").innerHTML;        

        var altura = contdoc.body.scrollHeight;
        controle.style.height = altura + "px";
        controle.style.width = contdoc.body.scrollWidth + "px";
        
        controle.style.left = "40%";
        controle.style.overflow = "hidden";
        if (Nav.IE6) {
            controle.style.backgroundAttachment = "fixed";
            controle.style.top = "100px";
            controle.style.position = "absolute";
            var top = (document.compatMode&&document.compatMode=='CSS1Compat')?document.documentElement.scrollTop+(document.documentElement.clientHeight-altura)/2:document.body.scrollTop+((document.body.clientHeight-altura)/2);
            controle.style.top = top+"px";
        } else {
            controle.style.position = "fixed";
            controle.style.top = "40%";
            controle.style.zIndex = "9999";
            controle.style.top = "40%";
        }
        
    }

    // rotina para elaboração de texto de chamada de mensagem
    IcftMessage.Mostra = function(nomecontrole, notamsg, identif, icone, botoes) {
        if (identif != undefined) 
            $(nomecontrole + "_Identif").innerHTML = identif;
            
        if (notamsg != undefined)
            $(nomecontrole + "_NotaMsg").innerHTML = notamsg;
        
        if (icone != undefined)
            $(nomecontrole + "_Icone").src = $(nomecontrole + "_Icone").attributes.path.value + "icone_" + icone + ".jpg";

        if (botoes != undefined) {
            var inner = "";
            var bts = botoes.split(";");
            for (var bt in bts) {
                inner += "<input id=\"" + nomecontrole + "_Btn" + bt + "\" type=\"button\" value=\"" + bts[bt] + "\" class=\"msg_botoes\" onclick=\"javascript:top.EscondeElemento('" + nomecontrole + "');\" />";
            }
            $(nomecontrole + "_BotoesArea").innerHTML = inner;
        }

        for (var i=5; i<arguments.length; i++) {
            var btn = $(nomecontrole + "_Btn" + (i-5));
            if (btn != undefined) {
                btn.param = arguments[i];
                btn.onclick = "javascript:top.doPostBack(this.param, '')";
            }
        }

        IcftMessage.Define(nomecontrole);
        MostraElemento(nomecontrole);    
        return false;
    }

//}



