// Trims a string
function trim(str, chars) {
  chars = chars || "\\s";
  str = str.replace(new RegExp("^[" + chars + "]+", "g"), "");
  return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

// Lists comma separated list of strings
function listLanguageItems(items) {
  var str = "";
  for(var item in items) {
    str += "'"+lang[items[item]]+"', ";
  }
  return str.substring(0, str.length - 2);
}

// Converts yes/no to true/false
function yesNo(value) {
  return value == "yes";
}

// ------------- Cache Control for IE

function randomizer() {
  var num = 10000000000000000 * Math.random(); // For IE
  return "&random="+num;
}
