
var rhapPlayer;
/** Beginning of Rhapsody SWFObject.js ... **/
/**
* SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
*
* SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* **SWFObject is the SWF embed script formarly known as FlashObject. The name was changed for
* legal reasons.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* N.B. -- This version of SWFObject replaces deconcept with Rhapsody_deconcept to avoid
* naming collisions with other versions of swfobject.js that might be on the
* same page.
*/
if(typeof Rhapsody_deconcept=="undefined"){var Rhapsody_deconcept=new Object();}
if(typeof Rhapsody_deconcept.util=="undefined"){Rhapsody_deconcept.util=new Object();}
if(typeof Rhapsody_deconcept.SWFObjectUtil=="undefined"){Rhapsody_deconcept.SWFObjectUtil=new Object();}
Rhapsody_deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=Rhapsody_deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new Rhapsody_deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=Rhapsody_deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
Rhapsody_deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){
_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new Rhapsody_deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();
return true;
}else{
if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
Rhapsody_deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new Rhapsody_deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new Rhapsody_deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{
var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_25=new Rhapsody_deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new Rhapsody_deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}
return _25;};
Rhapsody_deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
Rhapsody_deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
Rhapsody_deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){
var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){
return q.substring(q.indexOf("=",_2d)+1,_2e);
}}return "";}};
if(Array.prototype.push==null){
Array.prototype.push=function(_2f){
this[this.length]=_2f;
return this.length;};}
var Rhapsody_getQueryParamValue=Rhapsody_deconcept.util.getRequestParameter;
var Rhapsody_FlashObject=Rhapsody_deconcept.SWFObject; // for backwards compatibility
var Rhapsody_SWFObject=Rhapsody_deconcept.SWFObject;
/** ... End of Rhapsody SWFObject.js . **/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
For information on how to use this file, please see our
SDK under "Developers Guide" at http://webservices.rhapsody.com/
* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var RhapsodySimple = {
Version: '0.4',
environment: 'http://www.rhapsody.com',
DEBUG_LEVEL: 3, /* 1: alerts and throws error, 2: throws only, 3: alerts only */
instances: 0,
load: function(){
if(typeof rhapsodySimple != 'undefined') SimpleRhapsodyUtility.alertRhapsodyErrors("Rhapsody Simple may be included more than once on the page.");
rhapsodySimple = new Object();
/* Not currently requireing prototype.js
if((typeof Prototype=='undefined') ||
parseFloat( (Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1]) ) < 1.4)
alert("Rhapsody Simple requires v1.4.0 or higher of the Prototype JavaScript framework"); */
}
}
var RhapsodyUser = {
hasRhapX: function(){
return this.detectObject('RhapsodyPlayerEngine.RhapsodyPlayerEngineCtrl','Rhapsody ActiveX', 'rhp', 'application/rhapsody-plugin', 'RealNetworks Rhapsody');
},
SIMPLE__openPlayerPosition: screen.width - 290,
detectObject: function(ClassID, desc, ext, mime, name ){
if (this.UserAgent.isIE()){
if (this.IEDetectObject(ClassID, name)) return true;
else return false;
}
if(navigator.plugins){
if(this.NavDetectObject(desc, ext, mime, name)) return true;
else return false;
}
return false;
},
IEDetectObject: function(ClassID, name){
var result = true;
// Internet explorer on windows
if (this.UserAgent.isIE() && this.UserAgent.isWin()){
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('result = IsObject(CreateObject("' + ClassID + '")) \n');
document.writeln(' If (err) then');
document.writeln(' result = False');
document.writeln(' End If');
document.write('</SCRIPT\> \n');
}
return result;
},
NavDetectObject: function(desc, ext, mime, name){
var numPlugins = 0;
if(navigator.plugins) navigator.plugins.refresh();
numPlugins = navigator.plugins.length;
if (numPlugins == 0) return false;
for (var i=0; i < numPlugins; i++){
currentPlugin = navigator.plugins[i];
if (currentPlugin.name == name || currentPlugin.description == desc) return true;
// The number of mime-types associated with this plugin
numTypes = currentPlugin.length
// Write the mime-types
for (var j = 0; j < numTypes; j++){
if (currentPlugin[j].type == mime || currentPlugin[j].suffixes == ext ) return true;
}
}
return false;
},
UserAgent: {
isIE: function(){
return (navigator.userAgent.toLowerCase().indexOf("msie") != -1);
},
isNav: function(){
var agt = navigator.userAgent.toLowerCase();
return ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)) && (agt.indexOf('opera')==-1));
},
isWin: function(){
var agt = navigator.userAgent.toLowerCase();
return ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
},
isMac: function(){
var agt = navigator.userAgent.toLowerCase();
return (agt.indexOf("macintosh") != -1);
},
major: function(){
return navigator.appVersion;
}
}
}
/* * * * RhapsodyPlayer * * * * * * * * * * * * * * *
A Static Object for launching the
RhapWeb Player Remotely
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var RhapsodyPlayer = {
PCODE: "rn",
PCODE_OVERRIDE: "",
OCODE: null,
CPATH: null,
CJ_PID: null,
PLAYERNAME: null,
HAS_RHAPX: false, // ...only has a value after a playback attempt has been made
test: function(msg){
alert(msg);
},
queueTrack: function(prId){
SIMPLE__throwContent( "queue", prId, "track" );
},
queueAlbum: function(prId){
SIMPLE__throwContent( "queue", prId, "album" );
},
queuePlaylist: function(prId){
SIMPLE__throwContent( "queue", prId, "playlist" );
},
playTrack: function(prId){
this.playRhapsody( { id:prId, type:'track' } );
},
playAlbum: function(prId){
this.playRhapsody( { id:prId, type:'album' } );
},
/** playRadio() IS DEPRECATED. PLEASE USE playChannel() INSTEAD. **/
playRadio: function(prId){
this.playRhapsody( { id:prId, type:'radio' } );
},
/** playArtistRadio() IS DEPRECATED. PLEASE USE playArtistChannel() INSTEAD. **/
playArtistRadio: function(prId){
this.playRhapsody( { id:prId, type:'artistradio' } );
},
playChannel: function(prId){
this.playRhapsody( { id:prId, type:'radio' } );
},
playArtistChannel: function(prId){
this.playRhapsody( { id:prId, type:'artistradio' } );
},
playPlaylist:function(prId){
this.playRhapsody( { id:prId, type:'playlist' } );
},
queueRcid: function(prId){
if( SimpleRhapsodyUtility.isArray(prId) ){
prId = this._createTrackListString( prId );
}
SIMPLE__throwContent( "queue", prId, "" );
},
openSignInOut: function(actionName){
var prObj = new Object();
prObj=this.createPlayRhapsodyObjectFromRcid( "action."+actionName );
this.playRhapsody(prObj);
},
playRcid: function(prId){
var prObj = new Object();
if( SimpleRhapsodyUtility.isArray( prId ) ) prObj = { id: prId, type: 'track' };
else prObj = this.createPlayRhapsodyObjectFromRcid( prId );
this.playRhapsody(prObj);
},
setTrackingCodes: function(pcode,ocode,cpath){
this.PCODE = pcode;
this.OCODE = ocode;
this.CPATH = cpath;
},
setCommissionJunctionPID: function( cj_pid ){
this.CJ_PID = cj_pid;
this.PCODE = "cj";
this.OCODE = "affiliate";
this.CPATH = "aff";
},
setPlayerName: function( name ) {
this.PLAYERNAME = name;
},
playRhapsody: function(prObj){
var playRhapsodyValid = this.isValidPlayRhapsody(prObj);
if(playRhapsodyValid && playRhapsodyValid != "valid"){
SimpleRhapsodyUtility.alertRhapsodyErrors(playRhapsodyValid);
} else {
if( SimpleRhapsodyUtility.isArray(prObj.id) ){
prObj.id = this._createTrackListString( prObj.id );
} else if( typeof prObj.id == 'string' ){
prObj.id = this._stripMoniker( prObj.id );
}
SIMPLE__openPlayer(prObj.id, prObj.type);
}
},
isValidPlayRhapsody: function(prObj){
if( prObj && prObj.id && (""+prObj.id).indexOf("action.")==0 ) { return "valid"; }
var isValid = false;
var ERRORS = new Array(
"No Object passed to playRhapsody function",
"The playRhapsody function requires an id and a type property\n(simplified functions often require only an id)",
"The playRhapsody id property should be a Number, an RCID string, or an Array of numbers (when type='track').",
"The playRhapsody type property should be a String",
"The playRhapsody type property should have one of the following values:",
"The playRhapsody rcid string property should start with one of the following monikers:"
)
var playRhapsodyErrors = new Array();
var validRhapsodyType;
var validRcidMoniker;
if( prObj ){
if( !prObj.id || !prObj.type ){
playRhapsodyErrors.push(ERRORS[1]);
} else if( ( typeof prObj.id != "number" ) && ( typeof prObj.id != "string" ) && ( !SimpleRhapsodyUtility.isArray(prObj.id ) && ( prObj.type == 'track' ) ) ){
playRhapsodyErrors.push(ERRORS[2]);
} else if( ( typeof prObj.id == "string" ) && ( ( validRcidMoniker = this.isValidRcidMoniker( prObj.id ) ) != "valid" ) ){
playRhapsodyErrors.push(ERRORS[5] + validRcidMoniker);
} else if( typeof prObj.type != "string" ){
playRhapsodyErrors.push(ERRORS[3]);
} else if( ( validPlayRhapsodyType = this.isValidPlayRhapsodyType( prObj.type ) ) != "valid" ){
playRhapsodyErrors.push(ERRORS[4] + validPlayRhapsodyType);
} else return "valid";
} else playRhapsodyErrors.push(ERRORS[0]);
return playRhapsodyErrors;
},
createPlayRhapsodyObjectFromRcid: function( prId ){
var prObj = new Object();
if( this._getMonikerPrefix( prId ) == 'alb') prObj.type = 'album';
else if( this._getMonikerPrefix( prId ) == 'art') prObj.type = 'artistradio';
else if( this._getMonikerPrefix( prId ) == 'sta') prObj.type = 'radio';
else if( this._getMonikerPrefix( prId ) == 'ply') prObj.type = 'playlist';
else if( this._getMonikerPrefix( prId ) == 'mp') prObj.type = 'mp';
else prObj.type = 'track';
prObj.id = prId;
return prObj;
},
getPcode: function() {
return RhapsodyPlayer.PCODE_OVERRIDE?RhapsodyPlayer.PCODE_OVERRIDE:RhapsodyPlayer.PCODE;
},
isValidPlayRhapsodyType: function( type ){
var validTypes = [ 'track', 'album', 'radio', 'playlist', 'artistradio', 'mp' ];
var validTypeString = "";
for( var i=0; i<validTypes.length; i++ ){
if( type == validTypes[ i ] ) return "valid";
else validTypeString += "\n" + validTypes[ i ];
}
return validTypeString;
},
_stripMoniker: function( idString ){
return idString; // return idString.split( ".")[1];
},
_stripMonikers: function( idArray ){
var strippedIdArray = new Array();
for( var i=0; i<idArray.length; i++ ){
strippedIdArray.push( this._stripMoniker( idArray[i] ) );
}
return strippedIdArray;
},
_rcidMonikers: [ 'tra.', 'alb.', 'sta.', 'ply.', 'art.', 'mp.' ],
isValidRcidMoniker: function( rcidMoniker ){
// this cound be just a plain id so check and return valid if it is
if ((""+rcidMoniker).search(/^[0-9]/) > -1) return "valid";
var validRcidMonikers = this._rcidMonikers;
var validRcidMonikerString = "";
for( var i=0; i<validRcidMonikers.length; i++ ){
if( rcidMoniker.toLowerCase().indexOf( validRcidMonikers[ i ] ) > -1 ) return "valid";
else validRcidMonikerString += "\n" + validRcidMonikers[ i ];
}
return validRcidMonikerString;
},
_getMonikerPrefix: function( rcid ){
if( this.isValidRcidMoniker( rcid ) == 'valid' ) return ( "" + rcid ).split( "." )[0].toLowerCase();
},
_getTypeStringByMoniker: function( rcid ){
var moniker = this._getMonikerPrefix( rcid );
switch( moniker ) {
case 'tra': return "track";
case 'alb': return "album";
case 'ply': return "playlist";
case 'sta': return "radio";
case 'art': return "artistradio";
case 'mp': return "user playlist";
default: return "";
}
},
_createTrackListString: function( prIdArray ){
var trackListString = "";
var skippedCounter = 0;
for( var i=0; i<prIdArray.length; i++ ){
if( typeof prIdArray[i] == "number" ){
trackListString += prIdArray[i] + "+";
} else if( ( typeof prIdArray[i] == "string" ) && ( this.isValidRcidMoniker( prIdArray[i] ) == 'valid' ) ){
trackListString += this._stripMoniker( prIdArray[i] ) + "+";
}else skippedCounter++;
}
if( skippedCounter > 0 ) SimpleRhapsodyUtility.alertRhapsodyErrors( skippedCounter + " non-number or invalid moniker string array items were dropped from the Tracklist array." );
return trackListString;
}
}
/* * * * SimpleRhapsodyUtility * * * * * * * * * * * * * * * * *
A Static Object for encapsulating
commonly used Utilities
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var SimpleRhapsodyUtility = {
alertRhapsodyErrors: function(errors){
var errorString = "";
if( SimpleRhapsodyUtility.isArray( errors ) ){
for( var i=0; i<errors.length; i++ ){
errorString += errors[ i ] + "\n";
}
}
else if( typeof errors == 'string' ) errorString = errors;
if(RhapsodySimple.DEBUG_LEVEL == 1 || RhapsodySimple.DEBUG_LEVEL == 3) alert(errorString);
if(RhapsodySimple.DEBUG_LEVEL < 3) throw(errorString);
return false;
},
addLoadEvent: function(func){
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
},
addEvent: function( theElement, theEvent, theCallback ){
if( theElement.addEventListener ){
theElement.addEventListener( theEvent, theCallback, false );
}
else if( theElement.attachEvent ){
theElement.attachEvent( "on" + theEvent, theCallback );
} else return;
},
isArray: function(arr){
if( ( typeof arr == 'object' ) && ( typeof arr.pop != 'undefined' ) ) return true;
else return false;
}
}
var SimpleTracking = {
reportPlayAdd: function( action, type, rcid ){
var type = ( type == '' )?RhapsodyPlayer._getTypeStringByMoniker( rcid ):type;
RhapsodyTracking.sendLinkEvent( {
eVar17: 'Audio Req : ' + action + " : " + type,
prop18: 'E: Audio Req : ' + action + " : " + type,
eVar18: RhapsodyTracking?RhapsodyTracking.getPageName():"",
eVar31: RhapsodyTracking.getCustomMetric( "primaryContentId" )?RhapsodyTracking.getCustomMetric( "primaryContentId" ):"",
eVar32: RhapsodyTracking.getCustomMetric( "primaryContentName" )?RhapsodyTracking.getCustomMetric( "primaryContentName" ):"",
eVar33: RhapsodyTracking.getCustomMetric( "artistId" )?RhapsodyTracking.getCustomMetric( "artistId" ):"",
eVar34: RhapsodyTracking.getCustomMetric( "artistName" )?RhapsodyTracking.getCustomMetric( "artistName" ):"",
eVar35: RhapsodyTracking.getCustomMetric( "albumId" )?RhapsodyTracking.getCustomMetric( "albumId" ):"",
eVar36: RhapsodyTracking.getCustomMetric( "albumName" )?RhapsodyTracking.getCustomMetric( "albumName" ):""
}, {
type: 'custom',
linkName: 'Audio Play Request',
events: 'event1'
} );
}
}
var SimplePopUpBlockHandler = {
tripped: false,
stallTilPageLoad: false,
tryAgainFunction: null,
popUpBlockerDialogBox: null,
message: "A pop-up blocker has interfered with our ability to deliver the content you\'ve requested.",
messageSupplemental: "\nIf you continue to have problems, please restart your browser and try again. ",
alertUser: function( blockedFunction ){
var alertMessage = this.message;
if( !this.tripped ){
try{
if( this.stallTilPageLoad ) SimpleRhapsodyUtility.addLoadEvent( function(){ SimplePopUpBlockHandler.buildAlertDiv( blockedFunction ); } );
else this.buildAlertDiv( blockedFunction );
} catch(e) {
alertMessage += this.messageSupplemental;
alert( alertMessage );
this.tripped = true;
}
}
},
destroyDialogBox: function(){
this.popUpBlockerDialogBox.toggleMeddlesomeElements( true );
this.popUpBlockerDialogBox.destroy();
this.popUpBlockerDialogBox = null;
this.tripped = false;
this.stallTilPageLoad = false;
},
buildAlertDiv: function(blockedFunction){
var alertDiv = document.createElement( "DIV" );
this.tryAgainFunction = function(){
blockedFunction();
this.destroyDialogBox();
return false;
}
alertDiv.setAttribute("id", "popUpBlockHolder");
this.popUpBlockerDialogBox = new DialogBox();
with( this.popUpBlockerDialogBox ){
setWidth( 433 );
setMask( true );
centerInPage();
toggleMeddlesomeElements();
getHoldingElement().appendChild(alertDiv);
SimpleRhapsodyUtility.addEvent( window, 'scroll', function(e){ centerInPage(); });
}
alertDiv.innerHTML =
'<b class="xtop">' +
'<b class="xb1"><\/b>' +
'<b class="xb2"><\/b>' +
'<b class="xb3"><\/b>' +
'<b class="xb4"><\/b>' +
'<\/b>' +
'<h2 class="boxHeader">Pop-Up Blocker Detected<\/h2>' +
'<div class="popUpBlockMessage">' +
'<p>' + this.message + ' Click \'View Content\' to spawn the blocked window.<\/p>' +
'<div style="text-align: center; padding-top: 15px;">' +
'<div style="width: 10px; height: 23px; float: right; font-size: 0.1em;">&nbsp;<\/div>' +
'<div class="whiteButtonRight" style="width: 7px; height: 23px; float: right; font-size: 0.1em;" onClick="SimplePopUpBlockHandler.destroyDialogBox(); return false;">&nbsp;<\/div>' +
'<div class="whiteButton" style="float: right; line-height: 23px; width: 40px;">' +
'<a href="#" title="Cancel" onClick="SimplePopUpBlockHandler.destroyDialogBox(); return false;" class="boldWhiteLink"><b>Cancel<\/b><\/a>' +
'<\/div>' +
'<div class="whiteButtonLeft" style="width: 7px; height: 23px; float: right; font-size: 0.1em;" onClick="SimplePopUpBlockHandler.destroyDialogBox(); return false;">&nbsp;<\/div>' +
'<div style="width: 10px; height: 23px; float: right; font-size: 0.1em;">&nbsp;<\/div>' +
'<div class="whiteButtonRight" style="width: 7px; height: 23px; float: right; font-size: 0.1em;" onClick="window.location=\'' + RhapsodySimple.environment + '/-popuphelp\'">&nbsp;<\/div>' +
'<div class="whiteButton" style="float: right; line-height: 23px; width: 40px;">' +
'<a href="' + RhapsodySimple.environment + '/-popuphelp" title="Help" class="boldWhiteLink"><b>Help<\/b><\/a>' +
'<\/div>' +
'<div class="whiteButtonLeft" style="width: 7px; height: 23px; float: right; font-size: 0.1em;" onClick="window.location=\'' + RhapsodySimple.environment + '/-popuphelp\'">&nbsp;<\/div>' +
'<div style="width: 10px; height: 23px; float: right; font-size: 0.1em;">&nbsp;<\/div>' +
'<div class="whiteButtonRight" style="width: 7px; height: 23px; float: right; font-size: 0.1em;" onClick="SimplePopUpBlockHandler.tryAgainFunction(); return false;">&nbsp;<\/div>' +
'<div class="whiteButton" style="float: right; line-height: 23px; width: 80px;">' +
'<a href="#" title="View Content" onClick="SimplePopUpBlockHandler.tryAgainFunction(); return false;" class="boldWhiteLink"><b>View Content<\/b><\/a>' +
'<\/div>' +
'<div class="whiteButtonLeft" style="width: 7px; height: 23px; float: right; font-size: 0.1em;" onClick="SimplePopUpBlockHandler.tryAgainFunction(); return false;">&nbsp;<\/div>' +
'<\/div>' +
'<\/div>';
this.tripped = true;
}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Free floating Utilties DEPRECATED
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function playTrack(prId){
RhapsodyPlayer.playRhapsody( { id:prId, type:'track' } );
}
function playAlbum(prId){
RhapsodyPlayer.playRhapsody( { id:prId, type:'album' } );
}
function playRadio(prId){
RhapsodyPlayer.playRhapsody( { id:prId, type:'radio' } );
}
function playPlaylist(prId){
RhapsodyPlayer.playRhapsody( { id:prId, type:'playlist' } );
}
function playRhapsody(prObj){
RhapsodyPlayer.playRhapsody(prObj);
}
var HEARTBEATFREQUENCY = 500;
var SIMPLEJS_MAX_TRACKS = 15;
var SIMPLE_iframeFullAllRcids = "";
var SIMPLE_iframeRcidsForLater = "";
function SIMPLE__triggerRcidsForLaterMsie( type ) {
if( SIMPLE_iframeRcidsForLater && SIMPLE_iframeRcidsForLater.length > 0 ) {
setTimeout( "SIMPLE__writeSimpleJsIframe( 'queue', '" + SIMPLE_iframeRcidsForLater + "', '" + type + "' );", 1500 );
}
else {
SIMPLE_clearMsieIframe();
}
}
function SIMPLE__writeSimpleJsIframe( action, rcid, type ) {
var theIframe = document.getElementById("launchRhapsodyPlayerIFrame");
if( !theIframe ) { setTimeout( "SIMPLE__writeSimpleJsIframe('" + action + "','" + rcid + "','" + type + "')", 50 ); return; }
SIMPLE_iframeFullAllRcids = rcid;
var theRcidArray = SimpleRhapsodyUtility.isArray(rcid) ? rcid : (""+rcid).split("+");
if( theRcidArray.length > SIMPLEJS_MAX_TRACKS ) {
var newRcidArray = theRcidArray.slice(0,SIMPLEJS_MAX_TRACKS);
rcid = newRcidArray.join("+");
SIMPLE_iframeRcidsForLater = theRcidArray.slice(SIMPLEJS_MAX_TRACKS).join("+");
}
else {
SIMPLE_iframeRcidsForLater = "";
}
if( (type=="radio" || type=="channel") && RhapsodyPlayer._getMonikerPrefix(rcid)=="" ) { rcid = "sta." + rcid; }
if( (type=="artistradio" || type=="artradio") && RhapsodyPlayer._getMonikerPrefix(rcid)=="" ) { rcid = "art." + rcid; }
var theHtml =
"<html>\n" +
"<head>\n" +
" <scr"+"ipt>\n" +
" function doLaunch() {\n" +
" var THECONTROL;\n" +
" try {\n" +
" THECONTROL = new ActiveXObject(\"RhapsodyPlayerEngine.RhapsodyPlayerEngineCtrl.1\");\n" +
" if( THECONTROL ) {\n" +
" parent.RhapsodyPlayer.HAS_RHAPX = true;" +
" if( \"" + rcid + "\".indexOf('action.')==0 ) {" +
" parent.SIMPLE__openPlayerWindow( \""+rcid+"\", \""+type+"\", \"\", false, \"\", \"\", \"\", \"\");\n" +
" return;" +
" }" +
" var rawHeartbeat = THECONTROL.getUserData(\"RhapPlayerHeartbeat\");\n" +
" if( rawHeartbeat ) {\n" +
" var rightNow = new Date().valueOf();\n" +
" var heartbeatTime = rawHeartbeat - 0.0;\n" +
" \n" +
" if( rightNow-heartbeatTime < " + (HEARTBEATFREQUENCY*2) + " ) {\n" +
" var theEvent = (new Date()).valueOf() + '|||" + action +"|||" + rcid + "';\n" +
" THECONTROL.setUserData( \"SimpleJsEvent\", theEvent, false );\n" +
" parent.SIMPLE__triggerRcidsForLaterMsie('" + type + "');\n" +
// " alert('sent event to player... ' + theEvent);\n" +
" return;\n" +
" }\n" +
" }\n" +
" }\n" +
" } catch(e) { }\n" +
// " alert(\"Throwing window...\");\n" +
" if( \"" + rcid + "\".indexOf('action.')==0 ) {" +
" parent.SIMPLE__openPlayerWindow( \""+rcid+"\", \""+type+"\", \"\", false, \"\", \"\", \"\", \"\");\n" +
" return;" +
" }" +
" parent.SIMPLE__actuallyOpenPlayerWindowMsie( \""+action+"\", \""+type+"\", \"\", false, \"\", \"\", \"\", \"\");\n" +
" };\n" +
"\n" +
" </scr"+"ipt>\n" +
"</head>\n" +
"<body onLoad=\"doLaunch();\">\n" +
"</body>\n" +
"\n" +
"</html>";
var theDoc = theIframe.contentDocument;
if( !theDoc ) { theDoc = theIframe.contentWindow.document; }
theDoc.open();
theDoc.write(theHtml);
theDoc.close();
}
function SIMPLE_clearMsieIframe() {
var theIframe = document.getElementById("launchRhapsodyPlayerIFrame");
if( !theIframe ) { setTimeout("SIMPLE__actuallyOpenPlayerWindowMsie()",50); return; }
var theDoc = theIframe.contentDocument;
if( !theDoc ) { theDoc = theIframe.contentWindow.document; }
theDoc.open();
theDoc.write( "<html><head></head><body onLoad=\"\"></body></html>" );
theDoc.close();
var theIframeDiv = document.getElementById("launchRhapsodyPlayerIFrameDiv");
if( theIframeDiv ) { theIframeDiv.innerHTML = ""; }
}
function SIMPLE__actuallyOpenPlayerWindowMsie( action, type, title, remote, page, pageRegion, guid, origin ) {
SIMPLE_clearMsieIframe();
SIMPLE_iframeRcidsForLater = "";
SIMPLE__tryFlashPlayer( action, SIMPLE_iframeFullAllRcids, type, title, remote, page, pageRegion, guid, origin );
}
function SIMPLE__hasRhapXPluginFirefox() {
var desc = 'Rhapsody ActiveX';
var ext = 'rhp';
var mime = 'application/rhapsody-plugin';
var name = 'RealNetworks Rhapsody';
var numPlugins = 0;
if( navigator.plugins ) navigator.plugins.refresh();
numPlugins = navigator.plugins.length;
if( numPlugins==0 ) return false;
for( var i=0 ; i<numPlugins ; i++ ) {
currentPlugin = navigator.plugins[i];
if (currentPlugin.name == name || currentPlugin.description == desc) return true;
// The number of mime-types associated with this plugin
numTypes = currentPlugin.length
// Write the mime-types
for (j = 0; j < numTypes; j++)
{
if (currentPlugin[j].type == mime || currentPlugin[j].suffixes == ext ) return true;
}
}
return false;
}
function SIMPLE__attemptPlayEventFirefox( action, rcid, type ) {
var THECONTROL = document.getElementById("RhapXControl");
/** Ok, so, in Safari even if the plugin is actually available, it takes a few hundred
millis before the methods themselves are available... So if this fails, we'll just keep
trying until it works... **/
var rawHeartbeat = 0;
try { rawHeartbeat = THECONTROL.getUserData("RhapPlayerHeartbeat"); }
catch(e) { setTimeout( "SIMPLE__attemptPlayEventFirefox('"+action+"','"+rcid+"','"+type+"')", 100 ); return; }
if( rawHeartbeat ) {
var rightNow = new Date().valueOf();
var heartbeatTime = rawHeartbeat - 0.0;
if( rightNow-heartbeatTime < (HEARTBEATFREQUENCY*2) ) {
var theRcidArray = SimpleRhapsodyUtility.isArray(rcid) ? rcid : (""+rcid).split("+");
if( theRcidArray.length > SIMPLEJS_MAX_TRACKS ) {
var newRcidArray = theRcidArray.slice(0,SIMPLEJS_MAX_TRACKS);
rcid = newRcidArray.join("+");
var rcidsForLater = theRcidArray.slice(SIMPLEJS_MAX_TRACKS).join("+");
setTimeout( "SIMPLE__attemptPlayEventFirefox('queue','"+rcidsForLater+"','"+type+"')", 1000 );
}
if( (type=="radio" || type=="channel") && RhapsodyPlayer._getMonikerPrefix(rcid)=="" ) { rcid = "sta." + rcid; }
if( (type=="artistradio" || type=="artradio") && RhapsodyPlayer._getMonikerPrefix(rcid)=="" ) { rcid = "art." + rcid; }
var theEvent = (new Date()).valueOf() + '|||' + action + '|||' + rcid;
THECONTROL.setUserData( "SimpleJsEvent", theEvent, false );
if( navigator.userAgent.toLowerCase().indexOf("safari")>=0 ) {
document.getElementById('rhapXLoaderFirefox').innerHTML = " ";
}
return;
}
}
document.getElementById('rhapXLoaderFirefox').innerHTML = " ";
SIMPLE__tryFlashPlayer( action, rcid, type, "", false, "", "", "", "" );
}
if( !window.ActiveXObject ) {
document.write('<div id="rhapXLoaderFirefox" style="position: absolute; visibility: hidden; height: 0; width: 0; bottom: 0; left: 0;"><\/div>');
function onIdle() { }
function onError( errorCode ) { }
function getStateName( state ) { }
function onPlayStateChanged( oldState, newState ) { }
function onAuthenticateDone( result ) { }
function onTrackOpened( trackId ) { }
function onTrackClosed( trackId ) { }
function onBufferingProgress( percentage ) { }
function onDownloadProgress( percentage ) { }
function onPositionChanged( currentPosition ) { }
function onDurationChanged( currentDuration ) { }
function onXmlMessageDone( xml, errorCode ) { }
function onServerError( errorCode ) { }
function onLoginStateChanged(oldState, newState, status) { }
function onXmlMessageDone(xml,errorCode) { }
function onMetadataReceived( trackId ) { }
document.write("<scr"+"ipt event=\"onIdle()\" for=\"RhapXControl\">onIdle();</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onError( errorCode )\" for=\"RhapXControl\">onError( errorCode );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"getStateName( state )\" for=\"RhapXControl\">getStateName( state );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onPlayStateChanged( oldState, newState )\" for=\"RhapXControl\">onPlayStateChanged( oldState, newState );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onAuthenticateDone( result )\" for=\"RhapXControl\">onAuthenticateDone( result );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onTrackOpened( trackId )\" for=\"RhapXControl\">onTrackOpened( trackId );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onTrackClosed( trackId )\" for=\"RhapXControl\">onTrackClosed( trackId );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onBufferingProgress( percentage )\" for=\"RhapXControl\">onBufferingProgress( percentage );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onDownloadProgress( percentage )\" for=\"RhapXControl\">onDownloadProgress( percentage );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onPositionChanged( currentPosition )\" for=\"RhapXControl\">onPositionChanged( currentPosition );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onDurationChanged( currentDuration )\" for=\"RhapXControl\">onDurationChanged( currentDuration );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onXmlMessageDone( xml, errorCode )\" for=\"RhapXControl\">onXmlMessageDone( xml, errorCode );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onServerError( errorCode )\" for=\"RhapXControl\">onServerError( errorCode );</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onLoginStateChanged(oldState, newState, status)\" for=\"RhapXControl\">onLoginStateChanged(oldState, newState, status);</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onXmlMessageDone(xml,errorCode)\" for=\"RhapXControl\">onXmlMessageDone(xml,errorCode);</scr"+"ipt>");
document.write("<scr"+"ipt event=\"onMetadataReceived( trackId )\" for=\"RhapXControl\">onMetadataReceived( trackId );</scr"+"ipt>");
}
if( window.ActiveXObject ) {
document.write('<div id="launchRhapsodyPlayerIFrameDiv" style="position: absolute; width: 0; height: 0; visibility: hidden; bottom: 0; right: 0;"><\/div>\n');
document.write('<div id="launchFlashEmbedProxyDiv" style="width: 0; height: 0; bottom: 0; left: 0; position: absolute;"><\/div>\n');
}
else {
document.write('<div id="launchFlashEmbedProxyDiv" style="position:absolute; z-index:-2; height:2px;"><\/div>\n');
}
function SIMPLE__throwContent( action, rcid, type ) {
if( window.ActiveXObject ) {
var theIframe = document.getElementById("launchRhapsodyPlayerIFrame");
if( !theIframe ) {
var theIframeDiv = document.getElementById("launchRhapsodyPlayerIFrameDiv");
theIframeDiv.innerHTML +=
"<iframe style='position:absolute; z-index:0; width:1px; height:1px; visibility:hidden;' "
+ " id='launchRhapsodyPlayerIFrame' "
+ " src=''"
+ " ></iframe>";
}
SIMPLE__writeSimpleJsIframe( action, rcid, type );
}
else {
if( SIMPLE__hasRhapXPluginFirefox() ) {
var theDiv = document.getElementById("rhapXLoaderFirefox");
if( theDiv.innerHTML.length < 5 ) {
theDiv.innerHTML =
'<object id="RhapXControl" width=0 height=0 type="application/rhapsody-plugin">' +
' <param name="consolelog" value="0xF0033"/>' +
' <param name="filelog" value="0xFFFFFFFF"/>' +
' <param name="filelogpath" value="c:\\rhapxlog.txt"/>' +
'</object>';
}
if( document.getElementById("RhapXControl") ) {
RhapsodyPlayer.HAS_RHAPX = true;
if( (''+rcid).indexOf("action.")==0 ) {
SIMPLE__openPlayerWindow(rcid, type);
}
else {
SIMPLE__attemptPlayEventFirefox( action, rcid, type );
}
}
else {
setTimeout( "SIMPLE__throwContent('"+action+"','"+rcid+"','"+type+"')", 100 );
}
}
else {
if( (''+rcid).indexOf("action.")==0 ) {
SIMPLE__openPlayerWindow(rcid, type);
}
else {
SIMPLE__tryFlashPlayer( action, rcid, type, "", false, "", "", "", "" );
}
}
}
try{
SimpleTracking.reportPlayAdd( action, type, rcid );
} catch( e ){}
}
var SIMPLE_flashArgs;
function SIMPLE__tryFlashPlayer( action, id, type, title, remote, page, pageRegion, guid, origin ) {
// alert("Embedding flash...");
var app = document.getElementById( "popoutPlayer_engine" );
// if the app doesn't exist, create it...
if( !app ) {
var pcodeToUse = RhapsodyPlayer.getPcode();
var embedResult = SIMPLE__embedRhapsodyFlash( "engine", "launchFlashEmbedProxyDiv", "window", {"pcode":pcodeToUse,"autologin":false} );
if( embedResult>0 ) {
SIMPLE__openPlayerWindow( id, type, title, remote, page, pageRegion, guid, origin );
return;
}
}
SIMPLE_flashArgs = new Array();
SIMPLE_flashArgs['id'] = id;
SIMPLE_flashArgs['type'] = type;
SIMPLE_flashArgs['title'] = title;
SIMPLE_flashArgs['remote'] = remote;
SIMPLE_flashArgs['page'] = page;
SIMPLE_flashArgs['pageRegion'] = pageRegion;
SIMPLE_flashArgs['guid'] = guid;
SIMPLE_flashArgs['origin'] = origin;
// alert("calling SIMPLE_trySendingFlashMessage...");
SIMPLE_trySendingFlashMessage(action,id);
}
function SIMPLE_trySendingFlashMessage( action, id ) {
var app = document.getElementById( "popoutPlayer_engine" );
try {
if( app && app.getControlVersion() ) {
// alert("sending message...");
app.sendMessage( {"messageId":new Date(), "message":action+"|"+id, "targetId":"popupPlayer"} );
return;
}
}
catch(e) { }
setTimeout( "SIMPLE_trySendingFlashMessage('"+action+"','"+id+"')", 100 );
}
function onTargetMessageReceived( messageId, success ) {
// alert("onTargetMessageReceived( messageId: "+messageId+", success: "+success+" );");
if( !success ) {
SIMPLE__openPlayerWindow(
SIMPLE_flashArgs['id'],
SIMPLE_flashArgs['type'],
SIMPLE_flashArgs['title'],
SIMPLE_flashArgs['remote'],
SIMPLE_flashArgs['page'],
SIMPLE_flashArgs['pageRegion'],
SIMPLE_flashArgs['guid'],
SIMPLE_flashArgs['origin'] );
}
}
/* Below this comment are Functions copied from global.js */
function SIMPLE__openPlayer(id,type,title,page,pageRegion,guid,origin) {
SIMPLE__throwContent( "play", id, type );
}
function SIMPLE__openPlayerWindow(id, type, title, remote, page, pageRegion, guid, origin) {
try {
if (!rhapPlayer || rhapPlayer.closed) {
openThis(id, type, title, remote, page, pageRegion, guid, origin)
} else {
rhapPlayer.getMetaData(type,id,title,remote);
rhapPlayer.location.setParameter('page',page);
rhapPlayer.focus();
}
} catch (e) {
openThis(id, type, title, remote, page, pageRegion, guid, origin);
}
}
function openThis(id, type, title, remote, page, pageRegion, guid, origin){
// If there is an action, and the user doesn't have RhapX, show sign-in/out...
// Once we don't support RhapX anymore, this whole if should be kill't...
if( ( typeof id == 'string' ) && ( id.indexOf( "action." ) == 0 ) ) {
var playerTypeChoice = "do_check";
// This stuff shouldn't happen on Comcast or Comcast MP3 Store...
if( RhapsodyPlayer.getPcode()=="bby" || RhapsodyPlayer.getPcode()=="BBY" ) {
playerTypeChoice = "rhapx";
}
if( RhapsodyPlayer.getPcode()=="mtvnrockband" || RhapsodyPlayer.getPcode()=="mtv" || RhapsodyPlayer.getPcode()=="vh1" || RhapsodyPlayer.getPcode()=="cmt" || RhapsodyPlayer.getPcode()=="logo" ) {
playerTypeChoice = "flash";
}
if( RhapsodyPlayer.getPcode()=="rs" ) {
playerTypeChoice = "rhapx";
}
if( playerTypeChoice=="flash" || (playerTypeChoice=="do_check" && !RhapsodyPlayer.HAS_RHAPX) ) {
SignInOutDialogBox.showDialog(id.substring("action.".length));
return;
}
}
var playerLocation = RhapsodySimple.environment+'/player';
var successfulOpen = false;
var wname="rhapPlayer";
var width=270;
var height=570;
var trackingParameters = "";
if( RhapsodyPlayer.OCODE ) { trackingParameters += "&ocode="+escape(RhapsodyPlayer.OCODE); }
if( RhapsodyPlayer.PCODE || RhapsodyPlayer.PCODE_OVERRIDE ) { trackingParameters += "&pcode="+escape(RhapsodyPlayer.getPcode()); }
if( RhapsodyPlayer.CPATH ) { trackingParameters += "&cpath="+escape(RhapsodyPlayer.CPATH); }
if( RhapsodyPlayer.PLAYERNAME ) { trackingParameters += "&playername="+escape(RhapsodyPlayer.PLAYERNAME); }
if (title) {
playerLocation += "?type=" + type + "&id="+id +"&title="+title +"&remote="+remote + "&page=" + page + "&pageregion=" + pageRegion + "&guid=" + guid + "&from=" + origin + trackingParameters;
} else {
playerLocation += "?type=" + type + "&id="+id +"&remote="+remote + "&page=" + page + "&pageregion=" + pageRegion + "&guid=" + guid + "&from=" + origin + trackingParameters;
}
playerLocation += "&hasrhapx=" + RhapsodyPlayer.HAS_RHAPX;
if( RhapsodyPlayer.CJ_PID ) {
playerLocation = "http://www.tkqlhce.com/click-" + RhapsodyPlayer.CJ_PID + "-10436574?url=" + escape(playerLocation);
}
var openFunction=function(){
rhapPlayer = window.open( playerLocation,wname,"width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable,top=20,left="+RhapsodyUser.SIMPLE__openPlayerPosition+"" );
if((rhapPlayer!=null) && (typeof rhapPlayer!="undefined")){
if (!rhapPlayer.opener) rhapPlayer.opener = self;
rhapPlayer.focus();
return true;
}
}
successfulOpen=openFunction();
if(!successfulOpen){
SimplePopUpBlockHandler.alertUser( openFunction );
}
}
//
// Returns an error:
// 0 - ok
// 1 - need to upgrade flash
// 2 - other exception
//
function SIMPLE__embedRhapsodyFlash( type, elementName, wmode, flashVars ) {
var flashUrl=null;
var fpContext=null;
if( type=="popout" ) {
flashUrl = "http://playback.rhapsody.com/-static/players/popout/rhapsodyPopoutPlayer.swf";
fpContext = "popout";
}
if( type=="engine" ) {
flashUrl = "http://playback.rhapsody.com/-static/players/engine/rhapsodyPlaybackEngine.swf";
fpContext = "embeddedProxy";
}
if( type=="signin" ) {
flashUrl = "http://playback.rhapsody.com/-static/widgets/login/login.swf";
}
if( !flashUrl ) return;
var theSwfObject = new Rhapsody_SWFObject( flashUrl, "popoutPlayer_"+type, "100%", "100%", "9", "#eaeaea" );
if( !theSwfObject.installedVer.versionIsValid(new Rhapsody_deconcept.PlayerVersion([9,0,115])) ) {
return 1;
}
theSwfObject.addParam("scale", "noscale");
theSwfObject.addParam("allowScriptAccess", "always");
theSwfObject.addParam("scale", "noscale");
theSwfObject.addParam("wmode", wmode);
theSwfObject.addParam("SeamlessTabbing", false);
theSwfObject.addVariable("env", "production");
theSwfObject.addVariable("fp_context", fpContext);
if( flashVars ) {
for( flashVarName in flashVars ) {
theSwfObject.addVariable( flashVarName, flashVars[flashVarName] );
}
}
try {
theSwfObject.write(elementName);
}
catch( e ) {
return 2;
}
return 0;
}
