<!-- 
// This script determines correct code required to embed MEDIA files 
// for a large number of browsers, including AOL and WebTV
// Windows Media Player is required and always used, except for WebTV
// Written by Les Gorven, http://midistudio.com/ 
// Ver. 3.0  Last Updated: January 17, 2006


function playFlash(video_url,v_dateiname){

document.write('<br /> ');
document.write('---------------------------------------------------------------------------------------------------------------');
document.write('<object height="300" width="450" data="/media/player_flv_maxi.swf" type="application/x-shockwave-flash" class="video2">');
		
document.write('<param name="movie" value="/media/player_flv_maxi.swf" />');
document.write( '<param name="allowFullScreen" value="true" />');
document.write( '<param name="startimage" value="" />') ;
document.write( '<param name="FlashVars" value="flv=' + v_dateiname );
document.write( '&amp;autoplay=1&amp;showstop=1&amp;height=300&amp;width=450&amp;showplayer=always&amp;showtime=1&amp;showfullscreen=1" />');
	
	
	
document.write('</object>');



}



function playMedia(mediaURL,rpt,height,width,auto) {

var mediaURL,rpt,height,width,auto

if (GetBrowser() == "Netscape") 
	embedMPlayer(mediaURL,rpt,height,width,auto);  
if (GetBrowser() == "IE") 
	embedIEobject(mediaURL,rpt,height,width,auto);
if (navigator.appName.substring(0,5) == "WebTV")
	embedSource(mediaURL,rpt,height,width,auto)
}

function embedSource(mediaURL,rpt,height,width,auto) {

    var CodeGen = ""
    var mediaURL,rpt,height,width
 		 	
	 CodeGen = '<embed src="' + mediaURL + '"' + '\n' ;
	 CodeGen += ' height=' + height + ' width=' + width ;
	 if (auto == 1) {
	 	CodeGen += ' autostart="true"';
	 } else {
		 CodeGen += ' autostart="false"';
	 }
	 CodeGen += '\n';
	 CodeGen += ' LOOP=' + rpt + '>'
	 
    document.write(CodeGen)

}


function embedMPlayer(mediaURL,rpt,height,width, auto)	{


		CodeGen = "" 
    	var mediaURL,rpt,height,width
		
				 	
		CodeGen = '<embed type="application/x-mplayer2" ' + '\n' ;
    	CodeGen = CodeGen + ' pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ' + '\n' ;
	 	CodeGen = CodeGen + 'Name="MediaPlayer" ' + 'src="' + mediaURL + '" ' + '\n' ;
	 	CodeGen = CodeGen + 'autoStart=' + auto + ' ' ;
		if ((height == 24) && (width == 299)) 
			CodeGen = CodeGen + 'ShowStatusBar=1 '; 
		if ((height >= 50) && (width >= 200)) 
			CodeGen = CodeGen + 'ShowStatusBar=1 '; 
		if ((height <= 49) && (width != 299))
			CodeGen = CodeGen + 'ShowStatusBar=0 '; 
		
		CodeGen = CodeGen + 'playCount=' + rpt + ' ' ;
		CodeGen = CodeGen + 'volume=-1 ' ;
		CodeGen = CodeGen + 'HEIGHT=' + height + ' WIDTH=' + width + '>'
				
		 
		document.write(CodeGen)
	
}

function embedIEobject(mediaURL,rpt,height,width,auto){


		CodeGen = "" 
    	var mediaURL,rpt,height,width

		CodeGen = '<object id=Player' + '\n' ;
		CodeGen += 'codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' + '\n' ;
		CodeGen += 'type=application/x-oleobject height=' + height + ' width=' + width + '\n' ;
		CodeGen += ' standby="Loading Microsoft® Windows® Media Player components..." ' + '\n' ;
		CodeGen += 'classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> ' + '\n' ;
		CodeGen += '<param NAME="Filename" VALUE="' + mediaURL + '">' + '\n' ;
		if ((height == 24) && (width == 299)) 
			CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">';
		if ((height >= 50) && (width >= 200)) 
			CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">'; 
		if ((height <= 49) && (width != 299))
			CodeGen += '<param NAME="ShowStatusBar" VALUE= "false"> ';
		if (auto == 1) {
			CodeGen += '<param NAME="autoStart" VALUE="true">';
		} else {
			CodeGen += '<param NAME="autoStart" VALUE="false">';
		}
		CodeGen += '<param NAME="Volume" VALUE="-1">' + '\n' ;
		CodeGen += '<param NAME="playCount" VALUE=' + rpt + '></object>'
		
		document.write(CodeGen)

}

function GetBrowser()
{
   var agt=navigator.userAgent.toLowerCase();
   if( ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) )
       return "IE";
   else if( ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
         && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
         && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)) )
       return "Netscape";
   else
       return "unknown";
}
//-->
