var PeeVeeObject = function(contenturl, usernumber, contentnumber, playsecond, width, height, restrict, playertype)
{
	this.contenturl = contenturl;
	this.usernumber = usernumber;
	this.contentnumber = contentnumber;
	this.playsecond = playsecond;
	this.width = 320;
	this.height = 290;

	if(restrict == undefined) {
		restrict = 0;
	} else {
		restrict = Number(restrict);
	}

	if(playertype == undefined) {
		playertype = 0;
	} else {
		playertype =  Number(playertype);
	}

	if(width != undefined) {
		this.width = width;
	}

	if(height != undefined) {
		this.height = height;
	}

  	if(restrict == 0) {
  		this.domain = 'peevee.tv';
  		this.acclog = "acc2";
  		this.suffix = "";
  		this.ext = ".swf";
  	} else {
  		switch(playertype) {
		case 0:
	  		this.domain = 'seel.peevee.tv';
	    	this.acclog = "acc2";
	    	this.suffix = "_seel";
	    	this.ext = ".jspx";
	    	break;
	    case 2:
	    	//this.height -= 110;
	  		this.domain = 'seel.peevee.tv';
	    	this.acclog = "acc2";
	    	this.suffix = "_seel";
	    	this.ext = ".jspx";

	    	var BaseURL     = "http://seel.peevee.tv/";
			var Volume	= 100;
			var AutoPlay 	= true;
			var PlayAll 	= false;
			var BlogTag 	= false;
			var FullScreen 	= true;
			var Message		= false;
			var MenuBar     = false;
			var Osusume		= false;
			var BGM			= false;
			var Debug		= false;

			var strFlagString = "";

			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=";
			}

			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";
			}

			if ( Debug ) {
				strFlagString += "&Debug=true";
			} else {
				strFlagString += "&Debug=false";
			}
			this.strFlagString = strFlagString;
			this.strPlayerFilename = "http://seel.peevee.tv/pluginplayerv6_seelhd.swf";
	    	break;
		}
  	}
	this.playertype = playertype;
    this.domainURI = 'http://' + this.domain;

}

var PVO = PeeVeeObject.prototype;

PVO.write = function()
{
  if(this.playertype == 0) {
	  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="pluginplayer" align="middle">');
	  document.write('<param name="allowScriptAccess" value="always" />');
	  document.write('<param name="movie" value="' + this.domainURI + '/pluginplayerv3' + this.suffix + this.ext + '?video_id=' + this.contenturl + '&playertype='+this.playertype + '" />');
	  document.write('<param name="quality" value="high" />');
	  document.write('<param name="bgcolor" value="#cccccc" />');
	  document.write('<param name="loop" value="false" />');

	  document.write('<embed src="' + this.domainURI + '/pluginplayerv3' + this.suffix + this.ext + '?video_id=' + this.contenturl + '&playertype=' + this.playertype + '" quality="high" bgcolor="#cccccc" loop="false" width="'+this.width+'" height="'+this.height+'" name="pluginplayer" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	  document.write('</embed>');
	  document.write('</object>');
  } else if(this.playertype == 2) {
	  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="' + this.strPlayerFilename + '" />');
	  document.write('<param name="quality" value="high" />');
	  document.write('<param name="FlashVars" value="CONTENT_NUMBER=' + this.contenturl + this.strFlagString + '" />');
	  document.write('<param name="wmode" value="transparent">');
	  document.write('<embed src="'+this.strPlayerFilename+'" quality="high" width="' + this.width + '" height="' + this.height + '" name="dummy_player_large" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="CONTENT_NUMBER=' + this.contenturl + this.strFlagString + '" wmode="trainsparent"/>');
	  document.write('</object>');
  }
  document.write('<img src="' + this.domainURI + '/externalcounter.jspx?Usernumber='+this.usernumber+'&Contentnumber='+this.contentnumber+'">');
}


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

 	this.domain = 'seel.peevee.tv';
   	this.acclog = "acc2";
   	this.suffix = "_seel";
   	this.ext = ".jspx";
    this.domainURI = 'http://' + this.domain;
	this.encusernumber = 48000000 + usernumber;
}

var SLO = SeelObject.prototype;

SLO.write = function()
{
  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="pluginplayer" align="middle">');
  document.write('<param name="allowScriptAccess" value="always" />');
  document.write('<param name="movie" value="' + this.domainURI + '/swfmovie' + this.ext + '?vid='+this.contentnumber + '&uid=' + this.usernumber + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="bgcolor" value="#cccccc" />');
  document.write('<param name="loop" value="false" />');
  document.write('<embed src="' + this.domainURI + '/swfmovie' + this.ext + '?vid='+this.contentnumber+'&uid='+this.usernumber+'" quality="high" bgcolor="#cccccc" loop="false" width="'+this.width+'" height="'+this.height+'" name="pluginplayer" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
  document.write('</embed>');
  document.write('</object>');
  document.write('<img src="' + this.domainURI + '/externalcounter.jspx?Usernumber='+this.usernumber+'&Contentnumber='+this.contentnumber+'">');
}