//#########################################################
// #
// # name        : getRequest
// #
// # description : Get request value
// #
// # param       : key (string)
// #
// # return      : value (string)
// #
// # author      : Tsuyoshi Mino
// #
//#########################################################
function getRequest(name) {
  if(location.search.length > 1) {
    if((spos=location.search.indexOf("?"+name+"=",0)) >= 0) {
      if((epos=location.search.indexOf("&",(spos+1))) >= 0) {
        return(location.search.substring(spos+("?"+name+"=").length,epos));
      } else {
        return(location.search.substring(spos+("?"+name+"=").length,location.search.length));
      }
    } else if((spos=location.search.indexOf("&"+name+"=",0)) >= 0) {
      if((epos=location.search.indexOf("&",(spos+1))) >= 0) {
        return(location.search.substring(spos+("&"+name+"=").length,epos));
      } else {
        return(location.search.substring(spos+("&"+name+"=").length,location.search.length));
      }
    }
  }
  return("");
}

