function ciptv(Player,PlayerState,PlayerWidth,FullPathNametoFLV)
{
	
if(	(PlayerState === undefined)	||	(PlayerState=="*")	)
   PlayerState = 'Play';

if((PlayerWidth === undefined) || (PlayerWidth=="*"))
   PlayerWidth=460;
	
if(FullPathNametoFLV === undefined)
	FullPathNametoFLV="NONE";

Adjust = PlayerWidth/460;
PlayerHeight=258*Adjust;

if( (navigator.userAgent.match(/iPhone/i)) ||  (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)) ) 
{
	JustFn=FullPathNametoFLV.lastIndexOf("/");
	JustFn=FullPathNametoFLV.substr(JustFn+1);
	JustFn=JustFn.replace(".flv",".mp4");
	NewPath="http://www.ciptv.co.uk/_p_ChamberTV/NEWS/PHONE/";

	document.write('<video controls height="' + PlayerHeight + '" width="' + PlayerWidth + '" src="' + 	NewPath+JustFn +'">');
	document.write('</video>');
}
else
{
L1='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + PlayerWidth + '" height="' + PlayerHeight + '" id="ChannelPlayerView-V3" align="middle">';

document.write(L1);

document.write('<param name="allowScriptAccess" value="always" />');

document.write('<param name="movie" value="http://www.chambermediaplayer.com/ChannelPlayerView-V4Embed.swf?PlayerName=' + Player + '&PlayerState=' + PlayerState +'&FullPath=' + FullPathNametoFLV + '&PSize=' + PlayerWidth +'" /><param name="quality" value="high" /><param name="allowFullScreen" value="true" /><param name="bgcolor" value="#000000" /><embed src="http://www.chambermediaplayer.com/ChannelPlayerView-V4Embed.swf?PlayerName=' + Player + '&PlayerState=' + PlayerState + '&FullPath=' + FullPathNametoFLV + '&PSize=' + PlayerWidth + ' quality="high" bgcolor="#000000" width="' + PlayerWidth + '" height="' + PlayerHeight + '" name="http://www.chambermediaplayer.com/ChannelPlayerView-V4Embed.swf" align="middle" allowScriptAccess="always" allowfullscreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');

document.write('</object>');
}

}

function ciptv_play(FullPathNametoFLV,PlayerWidth)
{
	if((PlayerWidth === undefined) || (PlayerWidth=="*"))
		PlayerWidth=460;
	
	ciptv("*","Play",PlayerWidth,FullPathNametoFLV);
}
	

////////////////////////DON'T AMEND BELOW HERE OLD VERSIONS

function ciptvV3(Player,PlayerState,PlayerWidth,FullPathNametoFLV)
{
	
if(	(PlayerState === undefined)	||	(PlayerState=="*")	)
   PlayerState = 'Play';

if((PlayerWidth === undefined) || (PlayerWidth=="*"))
   PlayerWidth=460;
	
if(FullPathNametoFLV === undefined)
	FullPathNametoFLV="NONE";

Adjust = PlayerWidth/460;
PlayerHeight=258*Adjust;

L1='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + PlayerWidth + '" height="' + PlayerHeight + '" id="ChannelPlayerView-V3" align="middle">';

document.write(L1);

document.write('<param name="allowScriptAccess" value="always" />');

document.write('<param name="movie" value="http://www.chambermediaplayer.com/ChannelPlayerView-V3.swf?PlayerName=' + Player + '&PlayerState=' + PlayerState +'&FullPath=' + FullPathNametoFLV + '" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="http://www.chambermediaplayer.com/ChannelPlayerView-V3.swf?PlayerName=' + Player + '&PlayerState=' + PlayerState + '&FullPath=' + FullPathNametoFLV + '" quality="high" bgcolor="#000000" width="' + PlayerWidth + '" height="' + PlayerHeight + '" name="http://www.chambermediaplayer.com/ChannelPlayerView-V3.swf" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');

document.write('</object>');	
}

function ciptv_playV3(FullPathNametoFLV,PlayerWidth)
{
	if((PlayerWidth === undefined) || (PlayerWidth=="*"))
		PlayerWidth=460;
	
	ciptvV3("*","Play",PlayerWidth,FullPathNametoFLV);
}
	

