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


	if(cobrandcode == null) {
		cobrandcode = 0;
	}
	
  	if(cobrandcode == 0) {
  		this.cobrandname = "PeeVee";
  		this.suffix = "";
  		this.domain = 'peevee.tv';
  		this.acclog = "acc2";
  		this.ext = ".swf";
  	} else if(cobrandcode == 21) {
    	this.cobrandname = "seel";
    	this.suffix = "_" + this.cobrandname;
  		this.domain = 'seel.peevee.tv';
    	this.acclog = "acc2";
  		this.ext = ".swf";
  		//this.ext = ".jspx";
  	}
    this.domainURI = 'http://' + this.domain;
}

var PVO = PeeVeeObject.prototype;

PVO.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 + '/pluginplayerv4' + this.suffix + this.ext + '?' + 'video_id='+this.contenturl+'" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="bgcolor" value="#cccccc" />');
  document.write('<embed src="' + this.domainURI + '/pluginplayerv4' + this.suffix + this.ext + '?' + 'video_id='+this.contenturl+'" quality="high" bgcolor="#cccccc" 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="http://blog.peevee.tv/cgi-bin/' + this.acclog + '/acclog.cgi?');
  document.write('referrer='+document.referrer+'&');
  document.write('width='+screen.width+'&');
  document.write('height='+screen.height+'&');
  document.write('color='+screen.colorDepth+'">');
  document.write('<img src="' + this.domainURI + '/externalcounter.jspx?Usernumber='+this.usernumber+'&Contentnumber='+this.contentnumber+'">');

  document.write('<script language="JavaScript" type="text/JavaScript">');
  document.write('function fullsize(param) {');
  document.write('moveTo(0,0);');
  document.write('resW = screen.availWidth;');
  document.write('resH = screen.availHeight;');
  document.write('inputText = "fullscreen=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,left=0,top=0,width=" + resW + ",height=" + resH;');
  document.write('testnum = window.open("' + this.domainURI + '/fullscreenplayer.jsp?Movie=" + param, "newWin", inputText);');
  document.write('}');
  document.write('</script>');
//  document.write('<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">');
//  document.write('</script>');
//  document.write('<script type="text/javascript">');
//  document.write('_uacct = "UA-1396231-6";');
//  document.write('urchinTracker();');
//  document.write('</script>');
}

//function fullsize(param) {
//  moveTo(0,0);
//  resW = screen.availWidth;
//  resH = screen.availHeight;
//  inputText = "fullscreen=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,left=0,top=0,width=" + resW + ",height=" + resH;
//  testnum = window.open('http://peevee.tv' + '/fullscreenplayer.jsp?Movie=' + param, 'newWin', inputText);
//}
