
var topicsNum = 0;

var topicsArry = new Array(10);
topicsArry[0] = '/flv/mobaemi20080904.swf';
topicsArry[1] = '/flv/20100421_traincha.swf';
topicsArry[2] = '/flv/20100421_dancehall.swf';
topicsArry[3] = '/flv/20100421_beegie.swf';
topicsArry[4] = '/flv/20100310_tap.swf';
topicsArry[5] = '/flv/20100317_hougakutw.swf';
topicsArry[6] = '/flv/20100421_waeuro.swf';
topicsArry[7] = '/flv/20100421_bnbmencore.swf';
topicsArry[8] = '/flv/20100400_chopin.swf';
topicsArry[9] = '/flv/20100118_kiyoshi.swf';
topicsArry[10] = '/flv/20100303_gorillaz.swf';

var topicsnewArry = new Array(0);
topicsnewArry[0] = '/flv/20100317_hougakutw.swf';


function chgTopics()
{
	
	writeFlash
	( 
		topicsArry[topicsNum]
	    , 'hight'         //quality 画質
	    , 'true'          //loop 繰り返し
	    , '#ffffff'       //bgcolor 背景色
	    , 'transparent'              //wmode 背景透明(WinIEのみ)
	    , 'true'          //play 自動再生
	    , 'true'          //menu 右クリックメニュー
	    , 'exhactfit'     //scale 幅高さが%の場合の縦横比等
	    , 'c'             //salign 表示領域内表示位置
	    , '180'          //height ムービーの高さ
	    , '418'          //width ムービーの幅
	    , '0'             //hspace まわりの余白(水平方向)
	    , '0'             //vspace まわりの余白(垂直方向)
	    , 'left'          //align 表示位置
	    , 'flash1'        //class クラス名
	    , 'taku1'         //id ID名
	    , 'taku1'         //name ムービー名
	    , ''              //style スタイル
	    , ''              //declare 読み込まれるだけで実行しない
	);
	
	time = 18000;
	topicsNum++;	if ( topicsNum > 10 ) topicsNum = 0;
	timerID = setTimeout( "chgTopics()", time );
}
function set_volume( vol ) {
	
    kigen = new Date();
    kigen.setTime( kigen.getTime() + ( 365 * 1000 * 60 * 60 * 24 ) );
    kigen2 = kigen.toGMTString();
　　document.cookie = "volume=" + vol + ";expires=" + kigen2;
	
}

function set_mute( vol ) {
	
    kigen = new Date();
    kigen.setTime( kigen.getTime() + ( 365 * 1000 * 60 * 60 * 24 ) );
    kigen2 = kigen.toGMTString();
　　document.cookie = "mute=" + vol + ";expires=" + kigen2;
	
}

function GetShuffle( arr ){
    var copy = new Array();
    for( var i=0; i<arr.length; i++ ) copy[i] = arr[i]; //配列の複製
    Shuffle( copy );
    return copy;
}

function Shuffle( arr ){
    for( var i=0; i<arr.length; i++ ){
        var backup = arr[i];
        var rand = Math.floor( Math.random() * arr.length );
        arr[i] = arr[rand];
        arr[rand] = backup;
    }
}


function writeFlash
( 
  /**
   * 引数
   */
   
     _swf      // フラッシュのURL
    ,_quality  // 画質
    ,_loop     // 繰り返し
    ,_bgcolor  // 背景色
    ,_wmode    // 背景透明(WinIEのみ)
    ,_play     // 自動再生
    ,_menu     // 右クリックメニュー
    ,_scale    // 幅高さが%の時の縦横比等
    ,_salign   // 表示領域内表示位置
    ,_height   // ムービーの高さ
    ,_width    // ムービーの幅
    ,_hspace   // まわりの余白(水平方向)
    ,_vspace   // まわりの余白(垂直方向)
    ,_align    // 表示位置
    ,_class    // クラス
    ,_id       // ID名
    ,_name     // ムービー名
    ,_style    // スタイル
    ,_declare  // 読み込まれるだけで実行しない

)
{
  /**
   * スクリプト
   */

  // タグ用文字列生成
  var htmObj = ""
  
  htmObj+="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'"
  htmObj+="        codebase='http://download.macromedia.com/pub/shockwave/"
                    htmObj+="cabs/flash/swflash.cab'";
  htmObj+="        width    = '" + _width   + "'";
  htmObj+="        height   = '" + _height  + "'";
  htmObj+="        hspace   = '" + _hspace  + "'";
  htmObj+="        vspace   = '" + _vspace  + "'";
  htmObj+="        align    = '" + _align   + "'";
  htmObj+="        class    = '" + _class   + "'";
  htmObj+="        id       = '" + _id      + "'";
  htmObj+="        name     = '" + _name    + "'";
  htmObj+="        style    = '" + _style   + "'";
  htmObj+="                    " + _declare  
  htmObj+="        >";
  htmObj+="<param  name     = 'movie'   value ='" + _swf     + "'>";
  htmObj+="<param  name     = 'quality' value ='" + _quality + "'>";
  htmObj+="<param  name     = 'loop'    value ='" + _loop    + "'>";
  htmObj+="<param  name     = 'bgcolor' value ='" + _bgcolor + "'>";
  htmObj+="<param  name     = 'play'    value ='" + _play    + "'>";
  htmObj+="<param  name     = 'menu'    value ='" + _menu    + "'>";
  htmObj+="<param  name     = 'scale'   value ='" + _scale   + "'>";
  htmObj+="<param  name     = 'salign'  value ='" + _salign  + "'>";
  htmObj+="<param  name     = 'wmode'   value ='" + _wmode   + "'>";
  htmObj+="";
  htmObj+="<embed                          ";
  htmObj+="        pluginspage='http://www.macromedia.com/go/getflashplayer'";
  htmObj+="        width    = '" + _width   + "'";
  htmObj+="        height   = '" + _height  + "'";
  htmObj+="        hspace   = '" + _hspace  + "'";
  htmObj+="        vspace   = '" + _vspace  + "'";
  htmObj+="        align    = '" + _align   + "'";
  htmObj+="        class    = '" + _class   + "'";
  htmObj+="        id       = '" + _id      + "'";
  htmObj+="        name     = '" + _name    + "'";
  htmObj+="        style    = '" + _style   + "'";
  htmObj+="        type     = 'application/x-shockwave-flash' ";
  htmObj+="                    " + _declare  ;
  htmObj+="        src      = '" + _swf     + "'";
  htmObj+="        quality  = '" + _quality + "'";
  htmObj+="        loop     = '" + _loop    + "'";
  htmObj+="        bgcolor  = '" + _bgcolor + "'";
  htmObj+="        play     = '" + _play    + "'";
  htmObj+="        menu     = '" + _menu    + "'";
  htmObj+="        scale    = '" + _scale   + "'";
  htmObj+="        salign   = '" + _salign  + "'";
  htmObj+="        wmode    = '" + _wmode  + "'";
  htmObj+="></embed>";
  htmObj+="</object>";

  var topicsSwf = document.getElementById( 'topics' );
  topicsSwf.innerHTML = htmObj;
}
