var PeeVeeObject = function(contenturl, content, title, username, rating, usernumber, contentnumber, domain, path, streamer, logo)
{
	this.contenturl = contenturl.replace(".mp4", ".flv");
    this.imageurl = this.contenturl.substring(contenturl.indexOf("/") + 1);
	this.imageurl = this.imageurl.replace(".flv", "_1.jpg");

	this.content = content;
    this.title = title;
    this.username = username;
    this.rating = rating;
    this.usernumber = usernumber;
    this.contentnumber = contentnumber;

    this.domain = domain;
    this.streamer = streamer;
    this.logo = logo;
    this.path = path;

    if(this.path == null) this.path = '/userdir/';

    this.uuid = Math.floor(Math.random() * 65556) +"_" + Math.floor(Math.random() * 65556) ;
	this.so = null;

	//this.domain = 'peevee.tv';
    //this.streamer = 'rtmp://dogaflv.nhk.or.jp/dogaflv/';
	//this.logo = 'wtrmrk.png';
}

var PVO = PeeVeeObject.prototype;

PVO.write = function()
{
	// Be sure to place plugin(.swf) at root, watermark in /img
	document.write('<script language="JavaScript"" type="text/javascript" src="http://' + this.domain + 'swfobject.js"></script>');
	document.write('<div id="player' + this.uuid + '">...</div>');
	document.write('<script language="JavaScript" type="text/javascript" defer>');
	document.write('this.so = new SWFObject("http://' + this.domain + 'pluginplayerv1_strm.swf","mpl' + this.uuid + '","496","404","9");');
	document.write("this.so.addParam('allowscriptaccess','always');");
	document.write("this.so.addParam('allowfullscreen','true');");

	document.write("this.so.addVariable('image', 'http://" + this.domain + "img/userimg/" + this.imageurl + "');");

	document.write("this.so.addVariable('streamer', '" + this.streamer + "');");
	document.write("this.so.addVariable('file', '"+ this.path + this.contenturl + "');");
	document.write("this.so.addVariable('skin', 'http://" + this.domain + "playerskinv1_swift.swf');");
	document.write("this.so.addVariable('logo', 'http://" + this.domain + "" + this.logo + "');");
	document.write("this.so.write('player" + this.uuid + "');");
	document.write("</script>");
}
