  function popup(url,title,width,height){
    var width2 = parseInt(width) + 30;
    var height2 = parseInt(height) + 30;
    var etc = "width=" + width2 + ",height=" + height2 + ",scrollbars=1,resizable=1,toolbar=0,menubar=0,location=0,directions=0,status=0";
    w=window.open(url,'popup',etc);
  }
  function externalLinkPopup(url) {
     var popupLink = "http://www.ibm.com/jp/pc/common/popup/popup.html?" + url;
     var etc = "width=470,height=360,scrollbars=1,resizable=1,toolbar=0,menubar=0,location=0,directions=0,status=0";
     w2=window.open(popupLink,'popup',etc);
  }
  var encodeFlg = false;
  function URLEncode(url) {
    var newUrl = stringReplace(encodeURI(url), "%u02DC", "~");
    if (!encodeFlg) newUrl = stringReplace(encodeURI(url), "%257E", "~");
    if (!encodeFlg) newUrl = stringReplace(encodeURI(url), "%26%23732%3B", "~");
    if (!encodeFlg) newUrl = stringReplace(encodeURI(url), "%uFFFD", "~");
    encodeFlg = false;
    externalLinkPopup(decodeURI(newUrl));
    return false;
  }
  function stringReplace( expression, findStr, replaceStr ) {
    var result = expression;
    if ( result.indexOf( findStr ) != -1 ) {
      if ( findStr == replaceStr ) return result;  // when same value, just return.
    }
    while ( result.indexOf( findStr ) > -1 ) {
      encodeFlg = true;
      result = result.substring( 0, result.indexOf( findStr ) ) + replaceStr + result.substring( result.indexOf( findStr ) + findStr.length, result.length );
    }
    return result;
  }
