// Multimedia Embedder Script by Othon Michalas, portal.corfumail.net
// Version 2.0 
// Free to use if this included
   

function MMediaembed(w,h,desc,url,as,ap) { 

   // The  Operating System is not a good idea but is simple (look plugin.js)
   // w = width, h = heigh , desc= description, url = filepath, 
   // as = auto play (0,1) , ap = autostart (True, False)

   var os = navigator.userAgent.toLowerCase().indexOf("windows") !=-1
   var oT = "audio/mpeg";
   var fp = url;
   var wd = w;
   var hg = h;
   var autos = as;
   var autop = ap;
   var fT = fp.substr(fp.lastIndexOf('.')+1, 3); 
   fT=fT.toLowerCase();

   if (os) 
	{ 
        oT = "application/x-mplayer2"; // Standard WinOS
	}
   else

	{


	if (fT == "wav") 
		{ oT = "audio/x-wav";
		}

   	else
		{

		if (fT == "aif") 
			{
			oT = "audio/x-aiff";
			}
		else
			{
			if (fT == "wma")
				{
				oT = "audio/x-ms-wma";
				}
			else
				{
   				if (fT == "mid")
					{
					oT = "audio/mid";
					}
				else
					{
					oT = "audio/mpeg";	
					}
				}
			}
		}         
	}
      document.writeln("<div id='"+desc+"'><center>"); 
      document.writeln(desc);
      document.writeln("</center><br/><object width='");
      document.writeln(wd);
      document.writeln("' height='");
      document.writeln(hg);
      document.writeln("'>");
      document.writeln("<param name='src' value='" + fp + "'/>");
      document.writeln("<param name='type' value='" + oT + "'/>");
      document.writeln("<param name='autostart' value='"+autop+"'/>");
      document.writeln("<param name='showcontrols' value='1'/>");    
      document.writeln("<param name='showstatusbar' value='1'/>");
      document.writeln("<embed src ='" + url + "' type='" + oT + "' autostart='"+autos+ "' autoplay='"+autop+"' width='280' height='69' controller='1' showstatusbar='1' kioskmode='true'>");
      document.writeln("</embed></object>");
      document.writeln("<br/><center><a href='" + url + "' target='_blank'> Download</a></center></div>");
      document.close(); }
