﻿/*
Created by Chris Kimmel, Round Table Concepts, 2008
email:chriski@roundtableconcepts.net 

-- the code withing this file is 100% copyright free and derived from multiple sources. 
--  all FLV's and SWF's are Copyrighted by Tim Sterns / Talking Point. 


function to add to the onLoad for the body tag
ts_makeDiv(file,w,h,t,l,delay)
file = flv filename
w = width of div and flv (default 360)
h = height of div and flv (default 360)
t = top (0,0) postion for div/flv (default screen height - 360) lower left corner
l = left (0.0) postion for div/flv (default 0)
delay = provision adding a delay to the launch of the flv (in milliseconds)

*/
//alert("tpscript loaded")
var flvsvr = "rtmp://ssjgyk0sicd.rtmphost.com/VideoPlayer/"
var winHeight = 0;
var winWidth = 0;

/*
Prep all the parameters
*/

if( typeof( window.innerWidth ) == 'number' )
	{//Non-IE
	winWidth = window.innerWidth
	winHeight = window.innerHeight
	}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{//IE 6+ in 'standards compliant mode'
	winWidth = document.documentElement.clientWidth
	winHeight = document.documentElement.clientHeight
	} 
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{//IE 4 compatible
	winWidth = document.body.clientWidth
	winHeight = document.body.clientHeight
	}

//build and display flv/swf file
function tsloadFLA(file,w,h)
	{
		var so = new SWFObject("playerFLV.swf", "player_FLV", w, h, "8",0);
		so.addVariable("vSource", file);
		so.addVariable("vWidth", w);
		so.addVariable("vHeight", h);
		so.addParam("wmode", "transparent");
		so.write("ts_flashcontent");
	}
	
/*
create div and launch talent
*/	

function tsmakeDiv(file,w,h,t,l)
	{
		file=flvsvr+file+".flv"
		
		
		if (t==0)
			{
				t=(winHeight-(h-80));
			};
		if (l>(winWidth-w))
			{
				l=(winWidth-(w-80));
			};
		document.write('<div id="ts_flashcontent" name="ts_flashcontent" style="position:absolute; top:'+t+'px; left:'+l+'px; width:'+w+'px; height:'+h+'px;"></div>');	
		tsloadFLA(file,w,h)
	}