function Cache(id, wpt, name, url, lat, lon, type, owner, difficulty, terrain )
{
this.id=id;
this.wpt=wpt;
this.name=name;
this.url=url;
this.lat=lat;
this.lon=lon;
this.type=type;
this.owner=owner;
this.difficulty=difficulty;
this.terrain=terrain;

this.getImageURL=getImageURL;
this.getContent=getContent;
this.getZoomLink=getZoomLink;
} 

function getImageURL()
{
  var image;
  if(this.type==1) image = "http://www.geocaching.se/images/newcaches/2.gif";
  if(this.type==2) image = "http://www.geocaching.se/images/newcaches/3.gif";
  if(this.type==4) image = "http://www.geocaching.se/images/newcaches/8.gif";
  if(this.type==8) image = "http://www.geocaching.se/images/newcaches/4.gif";
  if(this.type==16) image = "http://www.geocaching.se/images/newcaches/11.gif";
  if(this.type==32) image = "http://www.geocaching.se/images/newcaches/earthcache.gif";
  if(this.type==64) image = "http://www.geocaching.se/images/newcaches/5.gif";
  if(this.type==128) image = "http://www.geocaching.se/images/newcaches/6.gif";
  if(this.type==256) image = "http://www.geocaching.se/images/newcaches/13.gif";
  if(this.type==512) image = "http://www.geocaching.se/images/newcaches/1858.gif";
  return image;
}

function getContent()
{
  var result;
  var localURL;
  localURL = "http://www.geocaching.se/?page=caches/cacheinfo&cache=" + this.wpt;
  result = this.name + " av " + this.owner + " (D:" + this.difficulty + "/T:" + this.terrain + ")<br>";
  result = result + "<a href=\"" + this.url + "\">Geocaching.com</a> <a href=\"" + this.url + "\" target=\"_blank\">(nytt fönster)</a> <br>";
  result = result + "<a href=\"" + localURL + "\">Cacheinfo</a> <a href=\"" + localURL + "\" target=\"_blank\">(nytt fönster)</a>";
  return result;
}

function getZoomLink()
{
  var result;
  result = "<a href=\"#\" onClick=\"zoomit(" + this.lat + "," + this.lon + ")\">" + this.wpt + " - " + this.name + "</a>";
  return result;
}

