
function resultsMap(div){
	
	this.mapDiv = div;
	
	this.mapObj = new rpwGmap(this.mapDiv);
	
	this.pathToRoot = "";
	
	this.setPathToRoot = function(path){
		this.pathToRoot = path;
	}
	
	this.setId = function(id){
		this.id = id;
		this.mapObj.setAttribute("id",id);
	}
	
	this.attributes = new Object();
	
	this.setAttribute = function(a,v){
		this.attributes[a] = v;
	}
	
	this.setAttributes = function(){
		for(var i=0;i<arguments.length;i+=2){
			this.attributes[arguments[i]] = arguments[i+1];
		}
	}
	
	this.getAttribute = function(a){
		return this.attributes[a];
	}

	this.loadResults = function(path,identifier,type,proxy){
		
		var action = (type == "property") ? "getpropertymapxml" : "getresultsmapxml";
		
		var url = (proxy != "") ? proxy : this.pathToRoot+"index.php";
		
		if(proxy != ""){
			this.mapObj.saveMapPosition = false;
		}
		
		url += "?action="+action+"&path="+path+"&identifier="+identifier+"&id="+this.id;
		
		for(var i in this.attributes){
			url += "&"+i+"="+escape(this.attributes[i]);
		}
		
		//alert(url);
		
		this.mapObj.loadProperties(url);		
		
	}
	
	
}


