
// Functions to run the RealPlayer plugin
// Copyright Andante Corp. 2001
// By Guillaume Herisson - July 12th 2001

var mesrealaudio="There may be a problem with the installation of RealAudio8 on your computer.\nIf you are having trouble loading your selection, please contact info@andante.com.";
var withcomments=1;

function SetWithComments(checkbox)
{
 if (checkbox.checked) withcomments=1;
 else withcomments=0;
 //alert("Hello World "+ withcomments);
}

function URLEncode(str) 
{
	var strObj = "";
	var c="";
	
	for(var i=0;i<str.length;++i) 
	{
	 c=str.substring(i,i+1);
	 if (c==" ") c="+";
	 if (c=="&") c="&amp;";
	 strObj=strObj+c;
	}
	return strObj;
}

function openPlayer(video,url,composer,work,performers,tcomposer,twork,tperformers)
{
 var width=345;
 requiredVersion = 6; // between 4 and 6

 /*if (!chekForRealPlayer())
 {
  alert(mesrealaudio);
 }*/
 if (checkForPlatform()!=PLATFORM_WIN32 || checkForBrowserType()!=BROWSER_IE)
 {
  width=360;
 }

 var url_1="http://www.andante.com/Player/Piece/pieceplayer.cfm?file="+url+"&video="+video+"&vComposer="+URLEncode(composer)+"&vWorkName="+URLEncode(work)+"&vPerformers="+URLEncode(performers)+"&txtComposer="+URLEncode(tcomposer)+"&txtWorkName="+URLEncode(twork)+"&txtPerformers="+URLEncode(tperformers);

 var win=null;
 if (video=='1')
 { 
 win=window.open(url_1,"andanteplayer3","height=398,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
 else
 {
 win=window.open(url_1,"andanteplayer4","height=200,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
}

// Directory
function openDirectoryPlayer(video,file,composer,work,performers)
{
 var address="http://real.andante.com/streams/andante/directories/";
 var url_1=address+file;
 openPlayer(video,url_1,composer,work,performers,'','','');
}

// Absolute link
function openPlayer1(url,composer,work,performers)
{
 var address="http://real.andante.com/";
 var url_1=address+url;
 openPlayer(0,url_1,composer,work,performers,'Composer','Title','Artists');
}

function openDefaultPlayer(url,composer,work,performers)
{
 var address="mms://www.andante.com/andante/";
 var url_1=address+url;
 openPlayer(0,url_1,composer,work,performers,'Composer','Title','Artists');
}

// Boutique
function openPlayer2(url,composer,work,performers)
{
 var address="http://www.andante.com/Boutique/CDCollection/samples/";
 var url_1=address+url;
 openPlayer(0,url_1,composer,work,performers,'Composer','Title','Artists');
}

// Radio Profiles
function openPlayer3(url,composer,work,performers)
{
 var address="http://www.andante.com/Musicroom/Radioprof/RPM/";
 var url_1=address+url;
 openPlayer(0,url_1,composer,work,performers,'Composer','Title','Artists');
}

// Magazine
function openPlayer4(url,composer,work,performers)
{
 var address="http://www.andante.com/Magazine/samples/";
 var url_1=address+url;
 openPlayer(0,url_1,composer,work,performers,'Composer','Title','Artists');
}

// Playing a piece
function openPlayer5(video,iConcPieceID,iConcTrackID)
{
 var width=345;
 requiredVersion = 6; // between 4 and 6

 /*if (!chekForRealPlayer())
 {
  alert(mesrealaudio);
 }*/
 if (checkForPlatform()!=PLATFORM_WIN32 || checkForBrowserType()!=BROWSER_IE)
 {
  width=360;
 }

 var url_1="http://www.andante.com/Player/Piece/pieceplayer.cfm?iConcPieceID="+iConcPieceID+"&video="+video+"&iConcTrackID="+iConcTrackID+"&withcomments="+withcomments;

 var win=null;
 if (video=='1')
 { 
 win=window.open(url_1,"andanteplayer1","height=540,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
 else
 {
 win=window.open(url_1,"andanteplayer2","height=320,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
}

// Playing a concert
function openPlayer6(video,iArticleID,title,subtitle)
{
 var width=345;
 requiredVersion = 6; // between 4 and 6

 if (checkForPlatform()!=PLATFORM_WIN32 || checkForBrowserType()!=BROWSER_IE)
 {
  width=360;
 }

 var url_1="http://www.andante.com/Player/Piece/pieceplayer.cfm?iArticleID="+iArticleID+"&video="+video+"&vTile="+URLEncode(title)+"&vSubtitle="+URLEncode(subtitle)+"&withcomments="+withcomments;

 var win=null;
 if (video=='1')
 { 
  win=window.open(url_1,"andanteplayer1","height=540,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
 else
 {
  win=window.open(url_1,"andanteplayer2","height=320,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
}

// Playing the radio
function openPlayer7()
{
 var width=345;
 requiredVersion = 6; // between 4 and 6

 if (checkForPlatform()!=PLATFORM_WIN32 || checkForBrowserType()!=BROWSER_IE)
 {
  width=360;
 }

 var url_1="http://www.andante.com/Player/Piece/pieceplayer.cfm?radio=1";

 var win=null;
 win=window.open(url_1,"andanteplayer2","height=320,width="+width+",status=no,toolbar=no,menubar=no,location=no");
}


// Playing a sample
function openSample(video,iConcPieceID,iConcTrackID)
{
 var width=345;
 requiredVersion = 6; // between 4 and 6

 /*if (!chekForRealPlayer())
 {
  alert(mesrealaudio);
 }*/
 if (checkForPlatform()!=PLATFORM_WIN32 || checkForBrowserType()!=BROWSER_IE)
 {
  width=360;
 }

 var url_1="http://www.andante.com/Player/Piece/pieceplayer.cfm?sample=1&iConcPieceID="+iConcPieceID+"&video="+video+"&iConcTrackID="+iConcTrackID+"&withcomments="+withcomments;

 var win=null;
 if (video=='1')
 { 
 win=window.open(url_1,"andanteplayer1","height=540,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
 else
 {
 win=window.open(url_1,"andanteplayer2","height=320,width="+width+",status=no,toolbar=no,menubar=no,location=no");
 }
}

function openCD(urlsmil,urlotmi,composer,work,performers)
{
    // open the new window
    if (window.winref && !window.winref.closed) 
    {
	 window.winref.close;
	}
	if (navigator.platform.indexOf('Mac')<0)
	{
     window.winref =window.open("http://digitalarts.otmi.net/andantespecial/player.asp?type=ie","andanteradio","height=336,width=397,status=no,toolbar=no,menubar=no,location=no");
	}
	else
	{
	 openPlayer(0, "http://digitalarts.otmi.net/andante3.smil",composer,work,performers,'Composer','Title','Artists');
	}
}

function openCD1()
{
    openCD("http://digitalarts.otmi.net/andante3.smil",
	       "http://digitalarts.otmi.net/andantespecial/player.asp?type=ie",
		   "","Italian Opera Arias","Jane Eaglen");
}

function openRadio()
{
 // open the new window
 if (window.winref && !window.winref.closed) 
 {
  window.winref.close;
 }

 window.winref =window.open("http://www.andante.com/Player/radio.cfm","andanteradio","height=295,width=360,status=no,toolbar=no,menubar=no,location=no");
 //document.location.href = "rtsp://digitalarts.otmi.net/andante.smil";

}





	

	
			
	



