/*
 * Purpose:	Handle the player after authentication
 *
 * CVS: $Id: authsubmit.js,v 1.3 2003/11/22 00:12:31 dsmith Exp $
 *
 * This file is a part of the Real Networks software library.
 * Copyright (C) 2001 Real Networks, Inc.
 * All rights reserved.
 *
 */

function submitMe( )
{
	var targetAry = new Array();
	var plyrObj=parent.window.external;
	var web_url=plyrObj.PlayerProperty("hidden_web_url");
	var stream_url=plyrObj.PlayerProperty("hidden_stream_url");
	var theForm = document.forms["forward"];
	var target_list = plyrObj.PlayerProperty("target_list");
	
		plyrObj.PlayerProperty("hidden_web_url")="";
		plyrObj.PlayerProperty("hidden_stream_url")="";
		plyrObj.PlayerProperty("target_list")="";
	/**
	var default_web_url = "http://switchboard.real.com/player/login.html?action="
		+plyrObj.PlayerProperty("loginpage")+"&parameter="+plyrObj.PlayerProperty("signinparam");
	**/
	web_url=(web_url.length!="")?web_url:"";
	
	if( stream_url != "" )
	{
		plyrObj.PlayClip(stream_url);
		plyrObj.PlayerProperty("cancel_login_reload")="true";
	}	
	if( web_url != "" )
	{
		plyrObj.OpenURLInPlayerBrowser( web_url );
		plyrObj.PlayerProperty("cancel_login_reload")="true";
	}
	var ret = "";
	if( target_list.length >= 0 )
	{
		targetAry = parent.arrayFromList( target_list );
		
		for( var i=0; i<targetAry.length; i++ )
		{
			var dest = plyrObj.PlayerProperty(targetAry[i])+"";
				plyrObj.PlayerProperty(targetAry[i])="";
				dest = dest.replace(/\,/g,"%2C");
			plyrObj.HandleAction( "NavigateToURL("+dest+", "+targetAry[i]+" )" );
			ret += "\nNavigateToURL("+dest+", "+targetAry[i]+" )"
		}
	}
	plyrObj.HandleAction("CloseWindow");
}


