var displayHeight = '432px';
var hiddenArea = '-1000px';
var lang = '';

function setLang(language)
{
	lang = language;
}

function setPageHeight(pageHeight)
{
	if (pageHeight && pageHeight > 0) displayHeight = pageHeight + 'px';
}

function thisMovie(movieName) 
{
	if (navigator.appName.indexOf("Microsoft") != -1) 
	{
		return window[movieName];
	} else {
		return document[movieName];
	}
}

function callPlayer(podCastUrl) 
{	
	if (pcWrapper.style.top == hiddenArea) 
	{
		pcWrapper.style.top = displayHeight;
	}
	thisMovie("podcast_player").playPodCast(podCastUrl);
}
	
function closePodCastPlayer()
{
	if (pcWrapper.style.top != hiddenArea) {
		pcWrapper.style.top = hiddenArea;
		thisMovie("podcast_player").stopPodCast();
	}
}
 
function initPodCastPlayer()
{
	var flashvars = {};
	
	var stageW = 600;	// video width
	var stageH = 510;	// video height  NOTE: you should include the control bar height
	
	flashvars.title 				= 	"";
	flashvars.description 			= 	"";
	flashvars.viewInfoButton 		=	"false"; // view information button  NOTE: this will display the title and description of the video
	flashvars.viewFullscreenButton 	=	"true";
	flashvars.viewScaleButton 		=	"false";
	flashvars.viewVolumeControls 	=	"true";
	flashvars.viewTime				=	"true";
	flashvars.viewBigPlayButton 	=	"true";
	flashvars.viewRightClickMenu 	=	"false";
	
	flashvars.mouseHide				=	"true"; // mouse hide
	flashvars.mouseHideTime			=	"3"; // mouse hide after # (seconds) NOTE : Must be a hole number !
	flashvars.doubleClick			=	"true"; // double click for toggle size view
	flashvars.oneClick				=	"true"; // click the video for play/pause
	flashvars.spaceKey				=	"true"; // play/pause on SPACE key
	
	flashvars.videoLoop				=	"false";
	flashvars.videoAutoPlay			=	"false";
	flashvars.videoBufferTime		=	"0.1";
	flashvars.tlInterval			=	"100000";
	flashvars.soundVolume			=	"0.8"; // sound volume at start NOTE :	1=Max	0=Min
	
	// size the video starts at NOTE: can be set to 1, 2 and 3
	// 1 for narmol size view
	// 2 for aspect view 
	// 3 for full size view
	flashvars.fullSizeView			=	"3";
	
	// spacing between the controls
	flashvars.spacing 				=	"3";
	
	// control bar height			( height )
	flashvars.controlHeight			=	"30";
	
	// vulume scrub lenght 			( lenght )
	flashvars.volumeLengthW			= 	"80";
	
	// controls background			( colors / alphas )
	flashvars.color1 				= 	"0x446343";
	flashvars.color2 				= 	"0x121a20";
	flashvars.alpha1 				= 	"1";
	flashvars.alpha2 				= 	"1";
	
	// controls border				( color / alpha )
	flashvars.borderColor 			= 	"0x446343";
	flashvars.borderAlpha			= 	"1";
	
	// time view
	// time view background			( colors / alphas )
	flashvars.timeColor1			= 	"0x809D4E";
	flashvars.timeColor2			= 	"0x111111";
	flashvars.timeAlpha1			= 	"1";
	flashvars.timeAlpha2			= 	"1";
	
	// time view text color			( color )
	flashvars.timeTextColor1		= 	"0x809D4E";
	flashvars.timeTextColor2		= 	"0x809D4E";
	
	// scrubber
	// scrubber height				( height )
	flashvars.scrubberHeight 		=	"4";
	
	// scrubber background 			( color / alpha )
	flashvars.scrubberColor1		= 	"0x446343";
	flashvars.scrubberAlpha1		= 	"1";
	
	// scrubber						( color / alpha )
	flashvars.scrubberColor2		= 	"0x809D4E";
	flashvars.scrubberAlpha2		= 	"1";
	
	// scrubber glow filter			( color / alpha )
	flashvars.filterColor			= 	"0x809D4E";
	flashvars.filterAlpha			= 	"0.7";
	
	// control buttons
	// control buttons color		( color )
	flashvars.filterColor			= 	"0x809D4E";
	
	// info view 
	// title color					( color )
	flashvars.titleColor			=	"0x000000";
	
	// description color			( color )
	flashvars.descriptionColor		=	"0x000000";
	
	// info background				( color / alpha )
	flashvars.infoBackgroundColor	=	"0x000000";
	flashvars.infoBackgroundAlpha	=	"0.5";
	
	// image path
	flashvars.imagePath				= "";
	
	// video dir
	flashvars.videoDir 				= "../audio";
	
	// video path
	flashvars.videoPath 			= "../audio/podcast_reedslaw_ms.flv";
	
	var params = {};
		params.scale = "noscale";
		params.allowfullscreen = "true";
		params.salign = "tl";
		params.bgcolor = "000000";
		params.allowscriptaccess = "always";
		params.allownetworking = "all";
		params.swliveconnect = "true";
		params.menu = "false";

	var attributes = {};
	
	flashPath = '';	
	if (lang != '') flashPath = '../';
	
		swfobject.embedSWF(flashPath + "flash/podcast_player.swf", "podcast_player", stageW, stageH, "10.0.0","", flashvars, params, attributes);
		pcWrapper.style.top = hiddenArea;
}