var strPlayerFilename  = "http://vision.chobirich.com/player/pluginplayer_chobirich.swf";

var PeeVeePlayer = function(contenturl, playsecond, width, height, usernumber, contentnumber )
{
	this.contenturl = contenturl;
	this.playsecond = playsecond;
	this.width = width;
	this.height = height;
	this.usernumber = usernumber;
	this.contentnumber = contentnumber;
}

var PVP = PeeVeePlayer.prototype;

PVP.write = function()
{
	var Volume	= 100;		
	var AutoPlay 	= false;
	var PlayAll 	= false;
	var BlogTag 	= false;
	var FullScreen 	= true;
	var Message		= false;
	var MenuBar     = false;
	var Osusume		= false;
	var BGM			= true;
	
	//	2010/02/18  Yoshiteru Ishida
	//  ログ集計用パラメータ追加
	strPlayerFilename += '?video_id=' + this.contenturl;

	var strFlagString = "";
	var BaseURL     = "http://vision.chobirich.com/";
	strFlagString += "&BaseURL=" + BaseURL;
	strFlagString += "&Volume=" + Volume;

	if ( AutoPlay ) {
		strFlagString += "&AutoPlay=true";
	} else {
		strFlagString += "&AutoPlay=";
	}

	if ( PlayAll ) {
		strFlagString += "&PlayAll=true";
	} else {
		strFlagString += "&PlayAll=";
	}
	
	if ( BlogTag ) {
		strFlagString += "&BlogTag=true";
	} else {
		strFlagString += "&BlogTag=";
	}

	if ( FullScreen ) {
		strFlagString += "&FullScreen=true";
	} else {
		strFlagString += "&FullScreen=";
	}

	if ( Message ) {
		strFlagString += "&Message=true";
	} else {
		strFlagString += "&Message=";
	}

	if ( this.width <= 200 ) {
		strFlagString += "&SmallFlag=true";
		this.height;
	} else {
		strFlagString += "&SmallFlag=";
	}
	
	strFlagString += "&rnd=1";

	if ( MenuBar ) {
		strFlagString += "&MenuBar=true";
	} else {
		strFlagString += "&MenuBar=false";
	}
	
	if ( Osusume ) {
		strFlagString += "&Osusume=true";
	} else {
		strFlagString += "&Osusume=false";
	}
	
	if ( BGM ) {
		strFlagString += "&BGM=true";
	} else {
		strFlagString += "&BGM=false";
	}

  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + this.width + '" height="' + this.height + '" id="dummy_player_large" align="middle">');
  document.write('<param name="allowScriptAccess" value="always" />');
  document.write('<param name="allowFullScreen" value="true" />');
  document.write('<param name="movie" value="' + strPlayerFilename + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="FlashVars" value="CONTENT_NUMBER=' + this.contenturl + strFlagString + '" />');
  document.write('<embed src="'+strPlayerFilename+'" quality="high" width="' + this.width + '" height="' + this.height + '" name="dummy_player_large" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="CONTENT_NUMBER=' + this.contenturl + strFlagString + '" />');
  document.write('</object>');
}
