function Contact() {
  this.id        = "";
  this.name		 = "";
  this.address   = "";
  this.city      = "";
  this.stateProv = "";
  this.postal    = "";
  this.phone     = "";
  this.fax       = "";
  this.email     = "";
  this.url       = "";
  this.type      = "";
}

Contact.prototype.toHtml = function() {
  o  = "<ul>";
  o += ((this.url!=null)   && (this.url!=''))     ? "<a href=\""+this.url+"\">" : "";
  o += "<li><strong>"+this.name+"</strong>";
  o += ((this.url!=null)   && (this.url!=''))     ? "</a>" : "";
  o +=	    "<br/>" + this.address+"<br/>"+
		              this.city+", "+this.stateProv+" "+this.postal+"<br/>";
  o += ((this.phone!=null) && (this.phone!=''))   ? "Tel: "+this.phone+"<br/>" : ""; ;
  o += ((this.fax!=null)   && (this.fax!=''))     ? "Fax: "+this.fax+"<br/>" : "";
  o += ((this.email!=null) && (this.email!=''))   ? "<a href=\"mailto:"+this.email+"\">"+this.email+"</a><br/>" : "";
  
  o += "</li>";
  o += "</ul>";
  return o;
}
Contact.prototype.setProperty = function(name, value) {
  eval("this."+name+" = \""+value+"\"");
}
Contact.prototype.getProperty = function(name) {
  return eval("this.name");
}

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