/*
Player script, developed by Pete Mulder, July 16 - 2006
copyright 2006, Feelslikefriday // the make it happen collective
*/
	
	var mediatotalheight = 320;
	var mediawidth = 435;
	var agt=navigator.userAgent.toLowerCase();
	
	var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	var is_mac   = (agt.indexOf("mac")!=-1);
	var is_opera = (agt.indexOf("opera") != -1);
	var is_gecko = (agt.indexOf('gecko') != -1);
	var is_ie    = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	var is_nav   = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
    	          && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
        	      && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));

	
	var codecAdvanced = 0;
	var codecAdvanced = 0;
	var showcontrols 	= 'true';
	var player 		= 'wmp';
	
	
	// drawing WMP object, based on set vars
	// drawWMP()
 
		
	function drawPlayer(mediaurl)	{
		if (is_win) 	{
			  //IE Code
			
			  document.write('<OBJECT');
			  document.write('  ID="MediaPlayer"');  
			  document.write('  CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"');
			  document.write('  CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"');
			  document.write('  bgcolor=#ffffff STANDBY="Loading Microsoft Windows Media Player components..."');
			  document.write('  TYPE="application/x-oleobject"  width="'+mediawidth+'" height="'+mediatotalheight+'">');

		     document.write ('<PARAM NAME="showControls" VALUE="true">');
		     document.write ('<PARAM NAME="fileName" VALUE="'+mediaurl+'">');
		     document.write ('<PARAM NAME="autostart" VALUE="true">');
		     document.write ('<PARAM NAME="AllowChangeDisplaySize" VALUE="True">');
		     document.write ('<PARAM NAME="animationatStart" VALUE="true">');
		     document.write ('<PARAM NAME="transparentatStart" VALUE="true">');

		   
		      //Netscape code
		      document.write('<EMBED TYPE="application/x-mplayer2"');
			  document.write('  PLUGINSPAGE="http://microsoft.com/windows/mediaplayer/en/download/"');
			  document.write('  ID=MediaPlayer NAME="MediaPlayer"');
			  document.write('  BGCOLOR="#ffffff"');
			  if (showcontrols == 'true') {document.write('  showcontrols=1 showstatusbar=0 showdisplay=0 showtracker=1 ');}
			  else	{document.write('  showcontrols=0 showstatusbar=0 showdisplay=0 showtracker=0 ');}
			  document.write('  VIDEOBORDER3D="-1"'); 
			  document.write('  WIDTH='+mediawidth);
			  document.write('  HEIGHT='+mediatotalheight);
			  document.write('  SRC="'+mediaurl+'"')
			  document.write('  AUTOSIZE="1" ');
			  document.write('  AllowChangeDisplaySize="1" ');
			  document.write('  DESIGNTIMESP="5311"');	
			  document.write('  >');
			  document.write('</EMBED>');
			  document.write('</OBJECT>');
				}
			 
		else 	{
			var WMP7;
			if ( (navigator.appName != "Netscape") && !(is_mac) )
				{WMP7 = new ActiveXObject('WMPlayer.OCX');
		}
		
		// Windows Media Player 7 Code
		if ( WMP7 )
			{
			 //IE Code
			 document.write('<OBJECT');
			 document.write('  ID="MediaPlayer"');  
			 document.write (' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6');
		     document.write (' standby="Loading Microsoft Windows Media Player components..."');
		     document.write (' TYPE="application/x-oleobject" width="'+mediawidth+'" height="'+mediatotalheight+'">');
		     document.write ('<PARAM NAME="url" VALUE="'+mediaurl+'">');
			 
		     document.write ('<PARAM NAME="showControls" VALUE="true">');
		     document.write ('<PARAM NAME="fileName" VALUE="'+mediaurl+'">');
		     document.write ('<PARAM NAME="autostart" VALUE="true">');
		     document.write ('<PARAM NAME="AllowChangeDisplaySize" VALUE="True">');
		     document.write ('<PARAM NAME="animationatStart" VALUE="true">');
		     document.write ('<PARAM NAME="transparentatStart" VALUE="true">');

			  //Netscape code
		     document.write('<EMBED TYPE="application/x-mplayer2"');
			 document.write('  PLUGINSPAGE="http://microsoft.com/windows/mediaplayer/en/download/"');
			 document.write('  ID=MediaPlayer NAME="MediaPlayer"');
			 document.write('  BGCOLOR="#000000"');
			 if (showcontrols == 'true') {document.write('  showcontrols=1 showstatusbar=0 showdisplay=0 showtracker=1 ');}
			 else {document.write('  showcontrols=0 showstatusbar=0 showdisplay=0 showtracker=0 ');}
			 document.write('  VIDEOBORDER3D="-1"'); 
			 document.write('  WIDTH='+mediawidth);
			 document.write('  HEIGHT='+mediatotalheight);
			 document.write('  SRC="'+mediaurl+'"')
			 document.write('  AUTOSTART="'+autoStartNr+'" ');
			 document.write('  AUTOSIZE="1" ');
			 document.write('  AllowChangeDisplaySize="1" ');
			 document.write('  DESIGNTIMESP="5311"');	
			 document.write('  >');
			 document.write('</EMBED>');
			 document.write ('</OBJECT>');
			}
		
		// Windows Media Player 6.4 Code
		else
			{
			 //IE Code
			 document.write('<OBJECT');
			 document.write('  ID="MediaPlayer"');  
			 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..." ');
		     document.write ('TYPE="application/x-oleobject" width="'+mediawidth+'" height="'+mediatotalheight+'">');
		     document.write ('<PARAM NAME="FileName" VALUE="'+mediaurl+'">');
		     document.write ('<PARAM NAME="showControls" VALUE="true">');
		     document.write ('<PARAM NAME="fileName" VALUE="'+mediaurl+'">');
		     document.write ('<PARAM NAME="autostart" VALUE="false">');
		     document.write ('<PARAM NAME="AllowChangeDisplaySize" VALUE="True">');
		     document.write ('<PARAM NAME="animationatStart" VALUE="true">');
		     document.write ('<PARAM NAME="transparentatStart" VALUE="true">');

		     //Netscape code
		     document.write ('    <Embed type="application/x-mplayer2"');
		     document.write ('        pluginspage="http://www.microsoft.com/windows/windowsmedia/"');
		     document.write ('        filename="'+mediaurl+'"');
		     document.write ('        src="'+mediaurl+'"');
		     document.write ('        Name=MediaPlayer');
		     document.write ('        ShowControls=1');
		     document.write ('        ShowDisplay=0');
		     document.write ('        ShowStatusBar=1');
		     document.write ('        width='+mediawidth+'');
		     document.write ('        height='+mediatotalheight+'>');
		     document.write ('    </embed>');
		
		     document.write ('</OBJECT>');
			}
		}
			 
	}
