
function oigeframe() {

if (top == self) window.location.href="p_"+/[^\/]+$/.exec(window.location.href)

}

function lehelopp() {

      document.writeln('<table width="615" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td>')
      document.writeln('<br><a href="mailto:?subject='+document.title+'&body='+window.location.href+'"')
      document.writeln('title="Send a link to this page to a friend." class="teisane">Email the page link</a><hr>')
      document.writeln('<p><a href="p_'+/[^\/]+$/.exec(window.location.href)+'" target="_top"><img src="images/Erplogo.gif"')
      document.writeln('alt="Estonian Record Production logo" width="200" height="45" border="0"></a></p>')
      document.writeln('<p class="tehniline">Click on the ERP logo to make a bookmarking of the page easy.</p></td></tr></table>')

}

   
function Player(filedesc,filepath,WindowNumber)

{

// Get Operating System 
var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1
if (isWin) {
    // Use MIME type = "application/x-mplayer2";
	visitorOS="Windows";
} else {
    // Use MIME type = "audio/mpeg"; // or audio/x-wav or audio/x-ms-wma, etc.
	visitorOS="Other";
}

var rpt=1	//korduste arv
var height=69	//MP k&otilde;rgus
var width=300	//MP laius

// Get the MIME type of the audio file from its extension (for non-Windows browsers)
var mimeType = "audio/mpeg"; // assume MP3/M3U
var theExtension = filepath.substr(filepath.lastIndexOf('.')+1, 3); // truncates .aiff to aif
if (theExtension.toLowerCase() == "wav") { mimeType = "audio/x-wav"};
if (theExtension.toLowerCase() == "aif") { mimeType = "audio/x-aiff"}; 
if (theExtension.toLowerCase() == "wma") { mimeType = "audio/x-ms-wma"};
if (theExtension.toLowerCase() == "mid") { mimeType = "audio/mid"};
// Add additional MIME types as desired

    PlayerWin = window.open('',WindowNumber,'width=320,height=110,top=0,left=0,screenX=0,screenY=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0');
    PlayerWin.focus();
    PlayerWin.document.writeln("<html><head><title>" + filedesc + "</title></head>");
    PlayerWin.document.writeln("<body style ='background-color: a9a9a9;'>");
    PlayerWin.document.writeln("<div align='center'>");
    PlayerWin.document.writeln("<span style ='font-family: \"Times New Roman\", Times, serif;font-size: medium;'>" + filedesc + "</span><br>");
	
if (visitorOS == "Windows") { 

if (GetBrowser() == "Netscape") 
	embedMPlayer(filepath,rpt,height,width);  
if (GetBrowser() == "IE") 
	embedIEobject(filepath,rpt,height,width);
if (navigator.appName.substring(0,5) == "WebTV")
	embedSource(filepath,rpt,height,width)
	
}	else {
    PlayerWin.document.writeln("<embed src ='" + filepath + "' type='" + mimeType + "' autoplay='true' width='" + width + "' height='" + height + "' controller='1' showstatusbar='1'></embed>");
}
	
    PlayerWin.document.writeln("</div>");
    PlayerWin.document.writeln("</body></html>");
    PlayerWin.document.close();
}



function embedSource(filepath,rpt,height,width) {

    var filepath,rpt,height,width
 		 	
	 PlayerWin.document.writeln('<embed src="' + filepath + '"');
	 PlayerWin.document.writeln(' height=' + height + ' width=' + width + ' autostart="true"')
	 PlayerWin.document.writeln(' LOOP=' + rpt + '></embed>')
}


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

function embedIEobject(filepath,rpt,height,width){

    	var filepath,rpt,height,width

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

}

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 if (agt.indexOf('opera')!=-1)
       return "Netscape";
   else
       return "unknown";
}