var _CLT = {
                TimeoutSec : 10,
                roots : ["att.com", "sbc.com", "bellsouth.com", "ourbellsouth.com"],
                skip : "ourbellsouth.com",
                loc : "localization.",
                environs :  [
                                {              
				    tests : ["esiwsd1", "localhost", "macdev"],
                                    prefix : "dev.",
                                    skip : "bellsouth.com"
                                },
                                {
                                    tests : ["ciarch5", "krabby", "mactest"],
                                    prefix : "test.",
                                    skip : "bellsouth.com"
                                },
                                {
                                    tests : ["iocecstgwww", "macpreprod"],               
                                    prefix : "stage.",
                                    skip : "ourbellsouth.com"
                                }
			    ],
                set : function(params, callback) {
			_CLT.callback = callback;
                        if (params !=  null && params.length > 0)
                        {
                                _CLT.imgCount = 0;
                                var prefix = (window.location.protocol ? window.location.protocol : "http:") + "//" + _CLT.getPrefix() + _CLT.loc;
                                this.images = new Array();
                                for (var i=0; i < _CLT.roots.length; i++) {
                                    if (_CLT.roots[i] != _CLT.skip) {
                                        this.images[i] = new Image();
                                        this.images[i].onload = _CLT.loaded;
                                        this.images[i].onerror = _CLT.loaded;
                                        this.images[i].src = prefix + _CLT.roots[i] + "/loc/controller?" + params;
                                    }
                                    else _CLT.loaded();                         
                                }              
                                _CLT.TimeoutID = window.setTimeout("_CLT.callback.call();", _CLT.TimeoutSec * 1000);
                        } else _CLT.callback.call();
		    },
                loaded : function(obj) {
                        _CLT.imgCount++;
                        if (_CLT.imgCount == _CLT.roots.length) 
                        {
                             window.clearTimeout(_CLT.TimeoutID);
                             _CLT.callback.call();
                        } 
		    },
                
                getPrefix : function() {
                        for (var i=0; i < _CLT.environs.length; i++)
                            for (var j=0; j < _CLT.environs[i].tests.length; j++)
                                if (window.location.href.indexOf(_CLT.environs[i].tests[j]) > -1) {
                                    _CLT.skip = _CLT.environs[i].skip;
                                    return _CLT.environs[i].prefix;
				}
                        return "";
		    }
}



