 function GetFileURL(filename)
    {
        var fileurl = "XX";
        jQuery.ajax({
                    async: false,
                    type: "GET",
                    url: "http://www.warbeats.com/GetFile.aspx?xml=1&f=" +filename,
                    dataType: "xml",
                    success: function(data) {  fileurl = ProcessFileURL(data);  },
                    error: function() { alert("Error getting file: " + filename); }
                });

         return fileurl;
    }

   function ProcessFileURL(data)
   {
        var fileurXl = jQuery(data).find('url').text();
        return fileurXl;

   }
   
   
function showad()
{
	document.write('<br /><div>');
	document.write('<hr><br /></div> ');
}

function embedtutorialS3(tutorial) 
{
	filename = 'http://www.warbeats.com/GetFile.aspx?f='+tutorial;
	
	wmvurl = GetFileURL(tutorial);
	
	document.write('<hr><div class="Normal" >Press PLAY or right click and press play on the video to start. <a href="http://www.warbeats.com/Forums/tabid/59/forumid/2/postid/40869/view/topic/Default.aspx" target="_blank">Trouble viewing this video?</a></div><br><div style="background-color: #343434;">');
	document.write('<OBJECT id="mediaPlayer" width="640" height="525" ');
	document.write('classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ');
	document.write('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"');
	document.write('standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
	document.write('<param name="fileName" value="'+wmvurl+'">');
	document.write('<param name="animationatStart" value="true">');
	document.write('<param name="transparentatStart" value="true">');
	document.write('<param name="autoStart" value="false">');
	document.write('<param name="showControls" value="true">');
	document.write('<param name="loop" value="false">');
	document.write('<EMBED type="application/x-mplayer2"');
	document.write('  pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"');
	document.write('  id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" ');
	document.write('  bgcolor="darkblue" showcontrols="true" showtracker="-1" ');
	document.write('  showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="640" height="525"');
	document.write('  src="'+wmvurl+'" autostart="0" designtimesp="5311" loop="false">');
	document.write('</EMBED>');
	document.write('</OBJECT>');
	document.write('</div>');
	//showad();
}

function embedrevver(id)
{
	document.write('<script src="http://flash.revver.com/player/1.0/player.js?mediaId:'+id+';affiliateId:96968;height:480;width:392;" type="text/javascript"></script>');
	showad();	
}

function embedhowcast(id)
{
	document.write('<object width="432" height="276" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="howcastplayer">');
	document.write('<param name="movie" value="http://www.howcast.com/flash/howcast_player.swf?file=' + id +'&theme=orange"></param>');
	document.write('<param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param>');
	document.write('<embed src="http://www.howcast.com/flash/howcast_player.swf?file='+id+'&theme=orange" ');
	document.write('type="application/x-shockwave-flash" width="432" height="276" allowFullScreen="true" allowScriptAccess="always" >');
	document.write('</embed></object>');
	showad();
}

function embedyoutube(id)
{
	document.write('<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'+id+'&rel=0"></param>');
	document.write('<param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+id+'&rel=0" ');
	document.write('type="application/x-shockwave-flash" wmode="transparent" width="425" height="344"></embed></object>');
	showad();
}

function embedyoutubeplaylist(id)
{
	document.write('<object width="425" height="344"><param name="movie" value="http://www.youtube.com/p/' + id + '"></param>');
	document.write('<embed src="http://www.youtube.com/p/' + id + '" type="application/x-shockwave-flash" width="425" height="344"></embed></object>');
	showad();
}

function embedgooglevid(id)
{
	document.write('<embed style="width:640px; height:480px;" id="VideoPlayback" type="application/x-shockwave-flash" ');
	document.write('src="http://video.google.com/googleplayer.swf?docId='+id+'&hl=en" flashvars=""> </embed>');
	showad();
}

function embedlink(url)
{
	document.write('<a target="_blank" href="http://www.warbeats.com/LinkClick.aspx?link=' + url + '" >' + url + '</a>');
}
