video_player_generator = function( p_video_tip, p_video_code, p_youtube_code, p_width, p_height, p_div_container )
{
	this.video_tip = p_video_tip;
	this.video_code = p_video_code;
	this.youtube_code = p_youtube_code;
	this.width = p_width;
	this.height = p_height;
	this.div_container = p_div_container;
}

video_player_generator.prototype.get_player = function ()
{
	if( this.video_tip > 0 ){
		// youtube
		if( this.video_tip == 1 )	{
			this.get_html_youtube();
		}
		// DailyMotion
		if( this.video_tip == 2 )	{
			this.get_html_dailymotion();
		}
	}
	if( this.youtube_code != '' ){
		this.video_code = this.youtube_code;
		this.get_html_youtube();
	}
}

video_player_generator.prototype.get_html_youtube = function()
{
	obj_swf =   new SWFObject("http://www.youtube.com/v/" + this.video_code, "mymovie", this.width, this.height, "7", "#000000");
	obj_swf.addParam("menu","false");
	obj_swf.addParam("wmode","transparent");
	obj_swf.addVariable("width", this.width );
	obj_swf.addVariable("height", this.height );
	obj_swf.write( this.div_container );
}

video_player_generator.prototype.get_html_dailymotion = function()
{
	var _arr_code = this.video_code.split("_");
	var _code = _arr_code[0];
	
	obj_swf =   new SWFObject("http://www.dailymotion.com/swf/" + _code, "mymovie", this.width, this.height, "7", "#000000");
	obj_swf.addParam("menu","false");
	obj_swf.addParam("allowFullScreen","true");
	obj_swf.addParam("allowScriptAccess","always");
	obj_swf.addVariable("width", this.width);
	obj_swf.addVariable("height", this.height);
	obj_swf.write( this.div_container );
}


