function writeTopMenu(flag) {
var thisLink = "_";
thisLink += document.location;

if (flag == 'Eng') {
  if (thisLink == "_http://lang.communigate.com/jp/default.html"  || 
		  thisLink == "_http://lang.communigate.com/jp/index.html"    || 
		  thisLink == "_http://lang.communigate.com/jp/") {
	    document.write("<a href=\"http://www.communigate.com\" title=\"English\">EN</a>|");
	  return;
  }
  if (thisLink == "_https://lang.communigate.com/jp/default.html" || 
		  thisLink == "_https://lang.communigate.com/jp/index.html"   || 
		  thisLink == "_https://lang.communigate.com/jp/") {
	  document.write("<a href=\"https://www.communigate.com\" title=\"English\">EN</a>|");
	  return;
  }

  switch (thisLink.substring(0,6)) {
	   case "_http:"	:	var subLink = thisLink.substring(31,thisLink.length) ; 
	                    document.write("<a href=\"http://www.communigate.com" + subLink + "\" title=\"English\">EN</a>|");
										  break;								
	   case "_https"	:	var subLink = thisLink.substring(32,thisLink.length) ; 
	                    document.write("<a href=\"https://www.communigate.com" + subLink + "\" title=\"English\">EN</a>|");
										  break;								
  }
  return;
}

if (flag == 'Jp') {
  if (thisLink == "_http://www.communigate.com/default.html"  || 
		  thisLink == "_http://www.communigate.com/index.html"    || 
		  thisLink == "_http://www.communigate.com/") {
	    document.write("<a href=\"http://lang.communigate.com/jp\" title=\"Japan\">JP</a>|");
	  return;
  }
  if (thisLink == "_https://www.communigate.com/default.html" || 
		  thisLink == "_https://www.communigate.com/index.html"   || 
		  thisLink == "_https://www.communigate.com/") {
	    document.write("<a href=\"http://lang.communigate.com/jp\" title=\"Japan\">JP</a>|");
	  return;
  }

  if (thisLink.indexOf("news.html")        >0 || 
			thisLink.indexOf("pressrel.html")    >0 || 
			thisLink.indexOf("podcasts.html")    >0 ||
			thisLink.indexOf("articles.html")    >0 ||
			thisLink.indexOf("reviews.html")     >0 || 
			thisLink.indexOf("accolades.html")   >0 ||
			thisLink.indexOf("events.html")      >0 ||
			thisLink.indexOf("speaker.html")     >0 ||
			thisLink.indexOf("mediacontact.html")>0 ||
			thisLink.indexOf("resellers.html")   >0
			) {
		document.write("<a href=\"http://lang.communigate.com/jp/\" title=\"Japan\">JP</a> |");
		return;
	}

  if (thisLink.indexOf("carrier")   >0 || 
			thisLink.indexOf("enterprise")>0 || 
			thisLink.indexOf("community") >0 ||
			thisLink.indexOf("aboutus")   >0) {
	  switch (thisLink.substring(0,6)) {
	     case "_http:"	:	var subLink = thisLink.substring(27,thisLink.length) ; 
	                      document.write("<a href=\"http://lang.communigate.com/jp" + subLink + "\" title=\"Japan\">JP</a>|");
										    break;								
	     case "_https"	:	var subLink = thisLink.substring(28,thisLink.length) ; 
	                      document.write("<a href=\"http://lang.communigate.com/jp" + subLink + "\" title=\"Japan\">JP</a>|");
										    break;				
		}
  }
  else {
	  document.write("<a href=\"http://lang.communigate.com/jp/\" title=\"Japan\">JP</a> |");
    return;
  }
  return;
}

return;
}