/*******************************************
Author: Darryl Yip
Date: 05/08/06

Dependencies: prototype.js
********************************************/

function Location(id, name) {
  this.id        	= id;
  this.name		  	= name;
  this.children     = new Array();
  
  this.setId   = function(value) { this.id = value; }
  this.getId   = function()      { return this.id; }
  this.setName = function(value) { this.name = value; }
  this.getName = function()      { return this.name; }  
}

//function to load the location xml data
Location.initialize = function(id, handler) {
  if( id != null ) {  
    myAjax = new Ajax.Request( locationsUrl,
							   { 
							     parameters: 'id='+id,
							     onFailure: function() { alert('Error'); },
							     onSuccess: eval(handler)
							   }
						     );
  }
}