<script language="javascript" type="text/javascript">
<!--
var maku_param = new Array("1つ目のコード", "2つ目のコード", "3つ目のコード");
var maku_first_no = -1;
var maku_interval = 30000;

var maku_old_no = -1;
var maku_timer_id;
var maku_is_random = 0;
var maku_random_switch = 1;

if (maku_first_no == -1) {
    show_maku_random();
}
else {
    show_maku_main(maku_first_no);
}
if (maku_interval > 0) {
    maku_timer_id = setInterval('show_maku_random()', maku_interval);
}

function show_maku_sub(param)
{
    html = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
    html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
    html += ' ID="maku" WIDTH="82" HEIGHT="94" ALIGN="">';
    html += ' <PARAM NAME=movie VALUE="http://maku.jp/maku.swf?' + param + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#ffffff> <EMBED src="http://maku.jp/maku.swf?' + param + '" quality=high bgcolor=#ffffff  WIDTH="82" HEIGHT="94" swLiveConnect=true ID="maku" NAME="maku" ALIGN=""';
    html += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"><' + '/EMBED>';
    html += '<' + '/OBJECT>';
    return html;
}

function show_maku_main(maku_no)
{
    maku_html = show_maku_sub(maku_param[maku_no]);
    maku_old_no = maku_no;
    document.getElementById('bpcl_maku').innerHTML = maku_html;
    if (maku_interval > 0 && !maku_is_random) {
        clearInterval(maku_timer_id);
        maku_timer_id = setInterval('show_maku_random()', maku_interval);
    }
}

function show_maku_random()
{
    if (maku_random_switch) {
        do {
            maku_new_no = Math.floor(Math.random() * maku_param.length);
        } while (maku_new_no == maku_old_no);
        maku_is_random = 1;
        show_maku_main(maku_new_no);
        maku_is_random = 0;
    }
}

function maku_random_on()
{
    maku_random_switch = 1;
}

function maku_random_off()
{
    maku_random_switch = 0;
}
//-->
</script>