function resize(o, w, h)
{
  var t = new Image();
  t.src = o.src;

  if((t.width > w) || (t.height > h)) {
    var arw = w / parseFloat(t.width);
    var arh = h / parseFloat(t.height);

    var ar = Math.min(arh, arw);

    o.width = parseInt(parseFloat(t.width) * ar);
    o.height = parseInt(parseFloat(t.height) * ar);
  }
}

function preview(o, s)
{
  o.src = "/Portals/0/Skins/CasaYes/Images/prev" + s.replace(",", "x") + ".png";
}