/*
	title:			動画再生処理
	author:		T.Nagayama (WITHWIND)
	description:	ホームページで公開する動画再生に関する各処理をおこなう。
	history:		
	required:		jquery.js(jQuery core)
*/

/*jQueryのおまじない*/
//var wwjq=jQuery.noConflict();
/*コアクラスの設定*/
//var wwcore;
//if(!wwcore)wwcore={};

/*
	動画プレイヤー表示
	wwcore.Movie
*/
wwcore.MoviePlayer; if(!wwcore.MoviePlayer)wwcore.MoviePlayer={};

wwcore.MoviePlayer.init = function(){
	this.movie_file = "2009_cm.asx";
	this.movie_file_640x480 = "2009_cm_640x480.asx";
	this.movie_path = "http://www.cmf-world.jp/expo/src/videos/";
	this.movie_xs = 240;
	this.movie_ys = 176;
	this.LB = " />\n";	//for XHTML
//	this.LB = " >\n";	//for HTML
	this.obj_id ="div#expo_movie";

	//for private value
	this.movie_fullpath= this.movie_path + this.movie_file;
	this.movie_fullpath_img= this.movie_path + this.movie_bgimg;
	this.movie_ys +=55;//wmp制御パネルエリア
}

wwcore.MoviePlayer.css = function(){
	wwjq(this.obj_id).width(this.movie_xs+30);
	wwjq(this.obj_id).height(this.movie_ys);
	
//	wwjq(this.obj_id).css( {
//		background: "#000 url("+ this.movie_fullpath_img + ") no-repeat scroll 0%" ,
//		backgroundPosition:"top"
//	} );
}

wwcore.MoviePlayer.object_tag = function(){
	var html = ""
	html  ='<object class="Player" data="'+ this.movie_fullpath +'" width="'+ this.movie_xs +'" height="'+ this.movie_ys +'" standby="Loading...">';
	html +='<param name="FileName" value="'+ this.movie_fullpath +'"'+ this.LB;
	html +='<param name="AutoStart" value="true"'+ this.LB;
	html +='<param name="PlayCount" value="0"'+ this.LB;
	html +='<param name="ShowStatusBar" value="true"'+ this.LB;
	html +='<param name="showControls" value="true"'+ this.LB;
	html +='<param name="ShowTracker" value="true"'+ this.LB;
	html +='<param name="ShowPositionControls" value="false"'+ this.LB;
	html +='<param name="ShowAudioControls" value="true"'+ this.LB;
	html +='<param name="bgcolor" value="#000000"'+ this.LB;
	html +='</object>';
	
	html +='<br /><div style="font-size:0.85em;"><a href="'+this.movie_path+this.movie_file_640x480+'" target="_blank">';
	html +='大きいサイズの動画はこちらからご覧頂けます。';
	html +='</a></div>';
	return html;
}

wwcore.MoviePlayer.set = function(){
	//初期設定
	this.init();
	//CSS設定
	this.css();
	//タグ挿入
	wwjq(this.obj_id).append( this.object_tag() );
}



/*処理実行*/
wwjq(function (){
	wwcore.MoviePlayer.set();
});




