

function Cor(cor){

    this.cor = cor;

    this.setCor = setCor;
    this.getCor = getCor;
    this.getCorDefault = getCorDefault;

    this.COR = {
        "ERRO":"#FFB3B3",
        "ATENCAO":"#FFFFAA",
        "OK":"#FFFFFF",
        "TITULO_DE_DOCUMENTO":
        "#D70000"
    }

    function getCorDefault (){
        return new Cor().COR.ATENCAO;
    }

    function setCor(_cor){
        cor = _cor;
    }

    function getCor(){
        if(cor == null)
            return  getCorDefault();

        return cor;
    }

    this.aplicar  = aplicar;
    this.reverter = reverter;

    function aplicar (campo){
        campo.style.backgroundColor = getCor();
    }

    function reverter(campo){
        campo.style.backgroundColor = "#FFFFFF";
    }
}



