function oshaberiSpeak(id) {
    var params = {}, text = "";
    if (id === "vdsRyakureki") {
        text += "衆議院議員、田中かずのり。";
        text += "自由民主党、神奈川第１０選挙区（川崎市川崎区・幸区・中原区）支部長。";
        text += "略歴。";
        text += "衆議院財務金融委員長。";
        text += "財務副大臣。";
        text += "外務大臣政務官、財務大臣政務官、国土交通大臣政務官。";
        text += "衆議院予算委員会理事、衆議院テロ・イラク特別委員会理事。";
        text += "衆議院教育基本法に関する特別委員会理事。";
        text += "党シャドウ・キャビネット、環境大臣。";
        text += "党副幹事長、党国会対策副委員長（現職・再任）、";
        text += "党財務金融部会長、自由民主党川崎市支部連合会 会長。";
        text += "公共物境界確定推進議員連盟会長（現職）。";
        text += "更生保護を考える議員の会 会長（現職）。";
        text += "街の酒屋さんを守る国会議員の会 会長（現職）。";
        text += "日本アフリカ連合友好(AU)議員連盟副会長（現職）。";
        text += "神奈川県日華親善協会 会長（現職）。";
        text += "川崎市日華親善協会 会長（現職）。";
        text += "川崎市サッカー協会 会長（現職）。";
        text += "川崎市ボウリング協会 会長（現職）。";
        text += "川崎市陸上競技協会 会長（現職）。";
        text += "川崎市釣連合会 会長（現職）。";
        text += "川崎ドッヂボール連盟会長（現職）。";
        text += "日本マーシャル諸島共和国協会名誉会長（現職）。";
        text += "神奈川県議会議員、川崎市議会議員。";
        text += "昭和24年1月21日、山口県下関市出身。";
        text += "法政大学法学部卒業。";
        text += "近未来政治研究会（山崎派）所属。";
        text += "衆議院議員５期連続当選。";
        future.setText(text);
    }
    params.castId = "2"; // 明るい男性の声
    params.volume = "9";
    params.rate = "13"; // ちょい速め
    future.speak(id, params);
    future.setText("");
}
function setOshaberiButtons(div, read_button, stop_button) {
    var input;

    div.style.width = "190px";

    input = window.document.createElement("input");
    input.type = "image";
    input.src = read_button;
    input.style.margin = "2px";
    input.onclick = function () {
        oshaberiSpeak(div.id);
    };
    div.appendChild(input);

    input = window.document.createElement("input");
    input.type = "image";
    input.src = stop_button;
    input.style.margin = "2px";
    input.onclick = function () {
        future.speakStop(div.id, null);
    };
    div.appendChild(input);
}
function oshaberiInit() {
    var read_button, stop_button, divs, div_size, i;

    read_button = "image/btn_read.gif";
    stop_button = "image/btn_stop.gif";
    if (window.location.pathname.indexOf("profile") >= 0) {
        read_button = "../image/btn_read.gif";
        stop_button = "../image/btn_stop.gif";
    }
    if (window.location.pathname.indexOf("seisaku") >= 0) {
        read_button = "../image/btn_read.gif";
        stop_button = "../image/btn_stop.gif";
    }

    divs = window.document.getElementsByTagName("div");
    div_size = divs.length;
    for (i = 0; i < div_size; i += 1) {
        if (divs[i].name) {
            if (divs[i].name === "vdsReadBtn") {
                setOshaberiButtons(divs[i], read_button, stop_button);
            }
        } else {
            if (divs[i].getAttribute("name") === "vdsReadBtn") {
                setOshaberiButtons(divs[i], read_button, stop_button);
            }
        }
    }

    future.setTargetTextHandler(function (text, id) {
        text = text.replace(/田中和德/g, "田中かずのり");
        text = text.replace(/甘利明/g, "あまりあきら");
        text = text.replace(/理森/g, "ただもり");
        text = text.replace(/義家弘介/g, "よしいえひろゆき");
        text = text.replace(/世耕弘成/g, "せこうひろしげ");
        text = text.replace(/僅かな/g, "わずかな");
        text = text.replace(/ＰＬＵＭ/g, "プラム");
        text = text.replace(/２トップ/g, "ツートップ");
        text = text.replace(/k-tanaka/g, "ケーハイフンティーエーエヌエーケーエー");
        text = text.replace(/\.or\.jp/g, "ドットオーアールドットジェイピー");
        text = text.replace(/２－２－１/g, "２の２の１");
        text = text.replace(/５０４号室/g, "５ゼロ４号室");
        text = text.replace(/芹洋子/g, "せりようこ");
        text = text.replace(/～/g, "、");
        text = text.replace(/(\d+)\:(\d+)/g, "$1時$2分");
        text = text.replace(/滋（しげる）/g, "しげる");
        text = text.replace(/早紀江（さきえ）様/g, "さきえさま");
        text = text.replace(/家族会前代表/g, "家族会ぜん代表");
        text = text.replace(/麻布支部/g, "あざぶ支部");
        text = text.replace(/菅副総理/g, "かん副総理");
        text = text.replace(/梅雨/g, "つゆ");
        text = text.replace(/COP１０/g, "コップテン");
        text = text.replace(/幸文化センター/g, "サイワイブンカセンター");
        text = text.replace(/直一/g, "ナオカズ");
        text = text.replace(/創エネ/g, "ソウエネ");
        text = text.replace(/未曾有/g, "みぞう"); 
        text = text.replace(/紅葉の時期/g, "こうようの時期"); 
        text = text.replace(/大迫力/g, "だい迫力");
        text = text.replace(/最小催行人数/g, "さいしょうさいこうにんずう");
        text = text.replace(/行っている/g, "おこなっている");

        text = text.replace(/李處長/, "リー處長");
        text = text.replace(/開かずの踏切/, "あかずの踏切");
        text = text.replace(/古市場/g, "ふるいちば");
        return text;
    });
}

