var office = {
	offices:	new Array(),
	
	getOfficePropertyById: function(officeId, propId){
		for(var i=0; i<office.offices.length; i++){
			if(office.offices[i][972].toLowerCase() == officeId.toLowerCase()){
				var o = office.offices[i][propId];
				if(o.length > 6 && o.substring(0, 7) != "http://")
					o = "http://"+o;
				return o;
			}
		}
		return util.NULL;
	},
	
	getAllOffices: function(){
		new Ajax.Request(constants.url.getalloffices, {
			method: "get",
			onSuccess: function(response){
				try{
					var cols  = response.responseXML.getElementsByTagName(rets.xml.columns)[0].firstChild.nodeValue.split(rets.delimiter);
					var datas = response.responseXML.getElementsByTagName(rets.xml.data);
					office.offices = util.buildResultObject(cols, datas);
				} catch(e){
					d.bug("query.getAllOffices(): " + e);	
				}
			}
		});
	}	
}