<!--

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function vote_DoFSCommand(command, args) {
  var voteObj = InternetExplorer ? vote : document.vote;
	
	if (command == "login")
	{
		performLogin();		
	}

}

function artistRating_DoFSCommand(command, args) {
  var artistRatingObj = InternetExplorer ? artistRating : document.artistRating;
	
	if (command == "login")
	{
		performLogin();		
	}

}

function albumRating_DoFSCommand(command, args) {
  var albumRatingObj = InternetExplorer ? albumRating : document.albumRating;
	
	if (command == "login")
	{
		performLogin();		
	}

}

function trackRating_DoFSCommand(command, args) {
  var trackRatingObj = InternetExplorer ? trackRating : document.trackRating;
	if (command == "login")
	{
		performLogin();		
	}

}

function audioComponent_DoFSCommand(command, args) {
  var audioComponentObj = InternetExplorer ? audioComponent : document.audioComponent;
	if (command == "login")
	{
		performLogin();		
	}
	else if (command == 'openPlayer')
	{
		openMediaPlayer(args);
	}

}

function audioComponent2_DoFSCommand(command, args) {
  var audioComponent2Obj = InternetExplorer ? audioComponent2 : document.audioComponent2;
	
	if (command == "login")
	{
		performLogin();		
	}
	else if (command == 'openPlayer')
	{
		openMediaPlayer(args);
	}

}

function homepage_DoFSCommand(command, args) {
  var homepageObj = InternetExplorer ? homepage : document.homepage;
	
	if (command == 'login')
	{
		performLogin();		
	}

}


// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');

	document.write('Sub vote_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call vote_DoFSCommand(command, args)\n');
	document.write('end sub\n');

	document.write('Sub artistRating_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call artistRating_DoFSCommand(command, args)\n');
	document.write('end sub\n');

	document.write('Sub albumRating_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call albumRating_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	
	document.write('Sub trackRating_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call trackRating_DoFSCommand(command, args)\n');
	document.write('end sub\n');	

	document.write('Sub audioComponent_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call audioComponent_DoFSCommand(command, args)\n');
	document.write('end sub\n');	

	document.write('Sub audioComponent2_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call audioComponent2_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	
	document.write('Sub homepage_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call homepage_DoFSCommand(command, args)\n');
	document.write('end sub\n');

	document.write('</SCRIPT\> \n');
}


function performLogin()
{
	//popup('/login/login.do','popup',615,535,0,0);
	document.location.href='/siteSubscription/subscribe.do'
}

function openMediaPlayer(mediaId)
{
	var path = '/mediaplayer/home.do?mediaId=' + mediaId;
	popup(path,'popup',646,520,0,0);
}

function renderFlash(flashFile, width, height) {
    var fplayer = new Flash ();
    fplayer.setSWF (flashFile, width , height);
    fplayer.setParam ('quality', 'best');
    fplayer.setParam ('play', 'true');
    fplayer.display ();
}

/*
	Compatibile XHTML Flash displayer
	Author 	: Razvan Stanga
	Website : http://www.phprebel.org/
	Date 	: 2006-03-07 17:39
*/

function Flash () {
	this._swf = '';
	this._width = 0;
	this._height = 0;
	this._params = new Array();
}

Flash.prototype.setSWF = function (_swf, _width, _height) {
	this._swf 		= _swf;
	this._width 	= _width;
	this._height 	= _height;
}

Flash.prototype.setParam = function (paramName, paramValue) {
	this._params[this._params.length] = paramName+'|||'+paramValue;
}

Flash.prototype.display = function () {
	var _txt 	= '';
	var params = '';
	_txt += '<object width="'+this._width+'" height="'+this._height+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">\n';
	_txt += '<param width="'+this._width+'" height="'+this._height+'" name="movie" value="'+this._swf+'" />\n'
	_txt += '<param name="quality" value="high" />\n';
	for ( i=0;i<this._params.length;i++ ) {
		_param = this._params[i].split ('|||');
		_txt += '\t<param name="'+_param[0]+'" value="'+_param[1]+'" />\n';
		params += _param[0]+'="'+_param[1]+'" ';
	}

	_txt += '<embed width="'+this._width+'" height="'+this._height+'" src="'+this._swf+'" '+params+' quality="high" type="application/x-shockwave-flash"></embed>\n';
	_txt += '</object>';
	document.write (_txt);
}

//-->