<?php

include_once dirname(__FILE__).'/class.record.php';
include_once dirname(__FILE__).'/class.player.php';



if (!isset($params['record']))
	return "";

$recordids = explode(",", $params['record']);
$record = new pRecord();
if (! $record->loaddb($recordids[0])) return "";


if (isset($params['player']))
	$playerid = $params['player'];
else
	$playerid = $record->player;

$player = new pPlayer();
if (! $player->loaddb($record->player)) return "";



if (isset($params['width']) && $params['width']>0)
	$width = $params['width'];
elseif ($record->width > 0 && count($recordids)==1)
	$width = $record->width;
else
	$width = $player->width;

if (isset($params['height']) && $params['height']>0)
	$height = $params['height'];
elseif ($record->height > 0 && count($recordids)==1)
	$height = $record->height;
else
	$height = $player->height;

if (count($recordids)==1)
	$flashvars = array_merge($player->params, $record->params);
else
	$flashvars = $player->params;




echo $this->ShowPlayerTemplate($id, $returnid, $player->template, $player->location, $params['record'], $width, $height, $flashvars);


?>