function show(id) {
  var elem = document.getElementById(id);
  if (!elem) return true;
  if (elem.style.display == "none")
  {
    elem.style.display = "block";
  }
  else
  {
    elem.style.display = "none";
  }
  return true;
}

function forward_guildstory(num_page) {
  switch (num_page) {
    case "1":
      location.href = "include.php?path=content/content.php&contentid=5";
      break;
    case "2":
      location.href = "include.php?path=content/content.php&contentid=32";
      break;
    case "3":
      location.href = "include.php?path=content/content.php&contentid=52";
      break;

    default:
      break;
  }
}

/**
 * trims a string by removing leading and trailing spaces
 */ 
function trimString(str) {
  str = (this != window) ? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
// define it as a prototype function for String object
String.prototype.trim = trimString;
