/*
 * CVS: $Id: render.js,v 1.3.16.1 2005/06/09 04:31:24 jchaney Exp $
 *
 * This file is a part of the Real Networks software library.
 * Copyright (C) 2001 Real Networks, Inc.
 * All rights reserved.
 *
 * Purpose:	Define frame rendering functions for the Firstrun page(s)
 *
 */
var iconOBJ = "";
var mainLayout="";
var contactingPage = false;

var stylesheet = "<LINK REL=STYLESHEET TYPE=\"text/css\" "
		+ "HREF=\"loc/"
		+ parent.window.external.PlayerProperty("LANGUAGEID")
		+ "/css.css\">\n"
		+ "<style>"
		+ ".btnBack { "
		+ "width:"+button_width+"px; "
		+ "height:"+button_height+"px; "
		+ "background-image: url(images/btns/"+button_dir+"/bttn_enabled.gif); "
		+ "cursor:default; "
		+ "color:#666666 "
		+ "}\n</style>";

var js_inserts = "<script src=\"loc/"
		+parent.window.external.PlayerProperty("LANGUAGEID")
		+"/index.js\"></sc"+"ript>"
		+"<script>"
		+"var button_dir = '"+button_dir+"';\n"
		+"var button_width = "+button_width+";\n"
		+"var button_height = "+button_height+";\n"
		+"</scr"+"ipt>"
		+"<script src=\"js/buttons.js\"><\/scr" + "ipt>";

function getBody3(formBody)
{
	var cP = parent.window.currentPage;

	contactingPage = false;

	mainLayout= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
		+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
		+ "<html><head>"+js_inserts+stylesheet+"</head>"
		+ "<body bgcolor=\"#D6D6D6\" text=\"#000000\" link=\"#666666\" alink=\"#666666\""
		+ "vlink=\"#0000ff\" topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0";

	if (screen.height <= 480)
		mainLayout += " scroll=yes ";
	else
		mainLayout += " scroll=no ";

	mainLayout += "onkeypress=\"parent.trapKeys();\" >"
  		+ "<table width=100% border=0 cellspacing=0 cellpadding=0 height=100% bgcolor=\"#FFFFFF\">"
        + "<tr>" 
      	+ "<td bgcolor=\"#666666\" colspan=3><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr><tr height=100%>"
		+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
     	+ "<td valign=top width=100%>" + formBody + "</td>"
      	+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
    	+ "</tr><tr>"
		+ "<td bgcolor=\"#666666\" colspan=3><img src=\"images/clear.gif\" width=1 height=1></td>"
    	+ "</tr>"
		+ "<tr><td colspan=3 bgcolor=d6d6d6>"+renderButtons()+"</td></tr>"
		+ "</table>"
		+ "</body></html>";

	return mainLayout
}

function getBody2(formBody)
{
	var cP = parent.window.currentPage;

	mainLayout= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
		+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
		+ "<html><head>"+js_inserts+stylesheet+"</head>"
		+ "<body bgcolor=\"#D6D6D6\" text=\"#000000\" link=\"#666666\" alink=\"#666666\""
		+ "vlink=\"#0000ff\" topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0";
	if (screen.height <= 480)
		mainLayout += " scroll=yes ";
	else
		mainLayout += " scroll=no ";
	mainLayout += "onkeypress=\"parent.trapKeys();\">"
  		+ "<table width=100% border=0 cellspacing=0 cellpadding=0 height=100% bgcolor=\"#FFFFFF\">"
        + "<tr height=100%>"
		+ "<td valign=top bgcolor=2363ab><img src=\"images/welcome.gif\" width=130></td>"
		+ "</td><td width=100%><table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr>"
      	+ "<td bgcolor=\"#666666\" colspan=4><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr><tr>"
      	+ "<td colspan=3><img src=\"images/clear.gif\" width=1 height=10></td>"
		+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr><tr height=100%>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
     	+ "<td width=100% valign=top>" + formBody + "</td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
      	+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
    	+ "</tr><tr>"
      	+ "<td colspan=3><img src=\"images/clear.gif\" width=1 height=10></td>"
		+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
    	+ "</tr><tr>"
		+ "<td bgcolor=\"#666666\" colspan=4><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr></table></td>"
		+ "</tr><tr><td bgcolor=d6d6d6 colspan=4>"
		+ renderButtons()
    	+ "</td></tr></table>"
		+ "</body></html>";
	return mainLayout;
}

function getBody(formBody)
{
	var cP = parent.window.currentPage;
	contactingPage = false;
	mainLayout= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
		+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
		+ "<html><head>"+js_inserts+stylesheet+"</head>"
		+ "<body bgcolor=\"#D6D6D6\" text=\"#000000\" link=\"#666666\" alink=\"#666666\""
		+ "vlink=\"#0000ff\" topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0";
	if (screen.height <= 480)
		mainLayout += " scroll=yes ";
	else
		mainLayout += " scroll=no ";
	mainLayout += "onkeypress=\"parent.trapKeys();\" >"
  		+ "<table width=100% border=0 cellspacing=0 cellpadding=0 height=100% bgcolor=\"#FFFFFF\">"
        + "<tr>"
      	+ "<td bgcolor=\"#666666\" colspan=5><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr><tr><td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td><td colspan=3><img src=\"images/clear.gif\" width=1 height=10></td><td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td></tr><tr>"
		+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
     	+ "<td valign=top height=100%>" + formBody + "</td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
      	+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr><tr><td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td><td colspan=3><img src=\"images/clear.gif\" width=1 height=10></td><td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td></tr><tr>"
		+ "<td bgcolor=\"#666666\" colspan=5><img src=\"images/clear.gif\" width=1 height=1></td>"
		+ "</tr><tr><td bgcolor=d6d6d6 colspan=5>"
		+ renderButtons()
    	+ "</td></tr></table>"
		+ "</body></html>";
	return mainLayout;
}

function getConnectBody(formBody)
{
	var cP = parent.window.currentPage;
	
	mainLayout= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"
		+ "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
		+ "<html><head>"+js_inserts+stylesheet+"</head>"
		+ "<body bgcolor=\"#D6D6D6\" text=\"#000000\" link=\"#666666\" alink=\"#666666\""
		+ "vlink=\"#0000ff\" topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0";
	if (screen.height <= 480)
		mainLayout += " scroll=yes ";
	else
		mainLayout += " scroll=no ";
	mainLayout += "onkeypress=\"parent.trapKeys();\" >"
  		+ "<table width=100% border=0 cellspacing=0 cellpadding=0 height=100% bgcolor=\"#FFFFFF\">"
        + "<tr>" 
      	+ "<td bgcolor=\"#666666\" colspan=5><img src=\"images/clear.gif\" width=485 height=1></td>"
		+ "</tr><tr height=100%>"
		+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=393></td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
     	+ "<td width=100% valign=top align=center><img src=\"images/clear.gif\" width=453 height=10><br>" + formBody + "</td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
      	+ "<td bgcolor=\"#666666\"><img src=\"images/clear.gif\" width=1 height=1></td>"
    	+ "</tr><tr>"
		+ "<td bgcolor=\"#666666\" colspan=5><img src=\"images/clear.gif\" width=485 height=1></td>"
		+ "</tr><tr><td bgcolor=d6d6d6 colspan=5>"
		+ renderConnectButtons()
    	+ "</td></tr></table>"
		+ "</body></html>";
	return mainLayout;
}

var startForm = "<form onsubmit=\"parent.window.falseSubmit();\">";

function renderMarketing( pageFrame )
{
	var dc = parent.window.external.PlayerProperty("DISTRIBUTIONCODE");
	var lc = data["language"];
	var cc = data["country"];
	if ( MRKTDISPLAY ) {
		var command = "javascript:parent.window.location=\"http://switchboard.real.com/player/mktg.html"
		+"?DC="+dc
		+"&optin="+data["contactme"]
		+"&country="+cc
		+"&language="+lc
		+ ((iconSet)?"&icon=tiscali":"")
		+"\"";
		document.location.href = command;
	} else {
		currentPage.render = renderForward;
		currentPage.render( pageFrame );
	}
}


function renderLogin( pageFrame )
{	
	if (!(data["haveacct"])) {
		if (!HASACCOUNT && plyrObj.PlayerProperty("configurationcomplete") != 1){
			setTimeout("currentPage = pages[\"account\"];currentPage.render(frsubbody);",300);
			return;
		}
	}
	
	var formItemColor=(error)?"#CC0000":"#666666";
	tabIndex=1;
	fiEmail.maxlength		 = 250;
	fiPassword.maxlength	 = 50;
	fiConfPassword.maxlength = 50;

	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%><tr><td>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%>" + startForm
	+ "<tr><td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "<td valign=top class=fstrn bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=1 height=10><br>"+this.headLines[0]+"<br>"
	+ this.desc[0]+"<br><img src=\"images/clear.gif\" width=1 height=10></td>"
	+ "<td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "</tr></table></td></tr>"
	+ "<tr><td><img src=\"images/grayline.gif\" width=100% height=1></td></tr>"
	+ "<tr><td><table border=0 cellpadding=0 cellspacing=0 width=100%>"
	+ "<tr><td><img src=\"images/clear.gif\" width=15 height=40></td>"
	
	if( error )
 	{
		retStr += "<td valign=center>"
			+ (alert_image?"<img src=\"images/alerts/"+alert_image+"\" width=32 height=32>":"")
			+ "</td>"
			+ "<td><img src=\"images/clear.gif\" width=15></td>"
			+ "<td width=100% class=fstrnerror valign=center>";
		if (errorcode == 008)
			retStr += this.errorMessage[1];
		else
			retStr += this.errorMessage[0];
		retStr += "</td>";
 	}else{	 	
		retStr += "<td>&nbsp;</td>";
 	}
	
	retStr += "<td><img src=\"images/clear.gif\" width=15></td></tr></table></td></tr>"
		+ "<tr height=100%><td width=100% valign=top align=center><TABLE border=0 cellpadding=0 cellspacing=0 width=100%>"
		+ "<tr><td rowspan=8><img src=\"images/clear.gif\" width=15></td>"
		+ "<td width=40% class=fstrn nowrap align=right><font color="
		+ formItemColor+"><label for=\""+this.formItems[0].id+"\">"+this.formItems[0].text+"</label>"+((this.formItems[0].required)?"*":"")+"</font></td>"
		+ "<td><img src=\"images/clear.gif\" width=15 height=1></td>"
 		+ "<td class=fstrn width=60%>"+this.formItems[0].render()+"</td>"
		+ "<td rowspan=8><img src=\"images/clear.gif\" width=20></td></tr>"
 		+ "<tr><td align=right class=fstrn nowrap><font color="
		+ formItemColor+"><label for=\""+this.formItems[0].id+"\">"+this.formItems[1].text+"</label>"+((this.formItems[1].required)?"*":"")+"</font></td>"
		+ "<td><img src=\"images/clear.gif\" width=15 height=1></td>"
 		+ "<td class=fstrn>"+this.formItems[1].render()+"</td></tr>"
		+ "<tr><td colspan=3><img src=\"images/clear.gif\" width=1 height=10></td></tr>"			
		+ "<tr><td align=right class=fstrnsmall>"+this.desc[1]+"</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
		+ "<tr><td colspan=3><img src=\"images/clear.gif\" width=1 height=12></td></tr>"			
		+ "<tr><td>&nbsp;</td><td>&nbsp;</td><td class=fstrn valign=bottom>"+this.pageLinks[0].render()
		+ "</td></tr>"
		+ "<tr><td colspan=3><img src=\"images/clear.gif\" width=1 height=5></td></tr>"
 		+ "<tr><td>&nbsp;</td><td>&nbsp;</td><td class=fstrn valign=bottom>"
 		+ this.pageLinks[1].render() + "<br><br></td></tr>"	
		+ "</form></table></td></tr><tr><td valign=bottom>"
		+ "<table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td align=right valign=bottom class=fstrnsmall width=40%>"
		+ this.pageLinks[2].render()
		+ "<br><img src=\"images/clear.gif\" height=15></td><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td width=60%></td><td><img src=\"images/clear.gif\" width=20></td>"
		+ "</tr></table>"
		+ "</td></tr></table>";
	renderPage( pageFrame, getBody3(retStr) );
}


function renderAccount( pageFrame )
{
	var formItemColor=(error)?"#CC0000":"#666666";
	tabIndex=1;	
	fiEmail.maxlength		 = 100;
	fiPassword.maxlength	 = 20;
	fiConfPassword.maxlength = 20;
	
	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%><tr><td valign=top>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%>" + startForm
	+ "<tr><td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "<td valign=top class=fstrn bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=1 height=10><br>"
	+ this.headLines[0]+"<br>"+this.desc[0]+"<br>"
	+ "<li>"+this.desc[1]+"</li>"
	+ "<li>"+this.desc[2]+"</li>"
	+ "<br><img src=\"images/clear.gif\" width=1 height=10></td>"
	+ "<td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "</tr></table>"
	+ "<img src=\"images/grayline.gif\" width=100% height=1><br>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%>"
	+ "<tr><td><img src=\"images/clear.gif\" width=15 height=40></td>"
	
	if( error )
 	{
		retStr += "<td valign=center>"
			+ (alert_image?"<img src=\"images/alerts/"+alert_image+"\" width=32 height=32>":"")
			+ "</td>"
			+ "<td><img src=\"images/clear.gif\" width=15></td>"
			+ "<td width=100% class=fstrnerror valign=center>";
		if (errorcode == 016){
			retStr += this.errorMessage[1];
		}else
			retStr += this.errorMessage[0];
		retStr += "</td>";
 	}else{	 	
		retStr += "<td>&nbsp;</td>";
 	}
	
	retStr += "<td><img src=\"images/clear.gif\" width=15></td></tr></table>"
		+ "<TABLE border=0 cellpadding=0 cellspacing=0>";
		
	for( var i=0; i<this.formItems.length-1; i++ )
	{
		retStr += "<tr><td><img src=\"images/clear.gif\" width=15></td>"
			+ "<td width=40% class=fstrn align=right>"
			+ "<font color="
			+ ((this.formItems[i].error)?formItemColor:"#666666")+">"
			+ this.formItems[i].text+""+"<font class=fstrnsmall>"+this.formItems[i].desc+"</font>"+((this.formItems[i].required)?"*":"")+"</font></td>"
			+ "<td><img src=\"images/clear.gif\" width=15 height=10></td>"
			+ "<td class=fstrn valign=bottom width=60%>" + this.formItems[i].render()
			+ "</td><td><img src=\"images/clear.gif\" width=15></td></tr>";
	}

	retStr += "<tr><td colspan=5><img src=\"images/clear.gif\" width=1 height=3></td></tr>";
		
	// display checkbox
	retStr += "<tr><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td class=fstrnsmall align=right valign=bottom>"+this.desc[3]+"</td>"
		+ "<td>&nbsp;</td>"
		+ "<td class=fstrnsmall width=100% valign=top>" + this.formItems[i].render() + "&nbsp;" + this.formItems[i].desc
		+ "</td><td><img src=\"images/clear.gif\" width=15></td></tr>";

	retStr += "<tr><td colspan=5><img src=\"images/clear.gif\" width=1 height=20></td></tr>";
	
	retStr += "</form></table></td></tr><tr><td valign=bottom>"
		+ "<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td width=40% align=right valign=bottom class=fstrnsmall>"
		+ this.pageLinks[1].render()
		+ "<br><img src=\"images/clear.gif\" height=15></td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td class=fstrn width=60% align=left>"	
		+ this.pageLinks[0].render()
		+ "<br><img src=\"images/clear.gif\" height=13></td>"	
		+ "<td><img src=\"images/clear.gif\" width=20></td>"
		+ "</tr></table>"
		+ "</td></tr></table>";
	renderPage( pageFrame, getBody3(retStr) );
}

function renderPclogin( pageFrame )
{	
	data["step"] = "pclogin";
	var formItemColor=(error)?"#CC0000":"#666666";
	tabIndex=1;

	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%><tr><td valign=top>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%><form>"
	+ "<tr><td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "<td valign=top class=fstrn bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" height=10><br>"+this.headLines[0]+"<br>"
	+ this.desc[0]+"<br><img src=\"images/clear.gif\" height=10></td>"
	+ "<td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "</tr></table>"
	+ "<img src=\"images/grayline.gif\" width=100% height=1><br>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%>"
	+ "<tr><td><img src=\"images/clear.gif\" width=15 height=40></td>"
	
	if( error )
 	{
		retStr += "<td valign=center>"
			+ (alert_image?"<img src=\"images/alerts/"+alert_image+"\" width=32 height=32>":"")
			+ "</td>"
			+ "<td><img src=\"images/clear.gif\" width=15></td>"
			+ "<td width=406 class=fstrnerror valign=center>";
		if (errorcode == 026)
			retStr += this.errorMessage[1];
		else
			retStr += this.errorMessage[0];
		retStr += "</td>";
 	}else{	 	
		retStr += "<td>&nbsp;</td>";
 	}
	
	retStr += "<td><img src=\"images/clear.gif\" width=15></td></tr></table>"
		+ "<TABLE border=0 cellpadding=0 cellspacing=0 width=100%>"
		+ "<tr><td rowspan=7><img src=\"images/clear.gif\" width=15></td>"
		+ "<td width=40% class=fstrn nowrap align=right><font color="
		+ formItemColor+"><label for=\""+this.formItems[0].id+"\">"+this.formItems[0].text+"</label>"+((this.formItems[0].required)?"*":"")+"</font></td>"
		+ "<td><img src=\"images/clear.gif\" width=15 height=1></td>"
 		+ "<td class=fstrn width=60%>"+this.formItems[0].render()+"</td>"
		+ "<td rowspan=7><img src=\"images/clear.gif\" width=20></td></tr>"
 		+ "<tr><td height=10 colspan=3><img src=\"images/clear.gif\" width=1 height=10></td></tr>"			
		+ "<tr><td align=right class=fstrnsmall>"+this.desc[2]+"</td><td>&nbsp;</td><td>&nbsp;</td></tr>"
		+ "<tr><td height=12 colspan=3><img src=\"images/clear.gif\" width=1 height=12></td></tr>"			
		+ "<tr><td>&nbsp;</td><td>&nbsp;</td><td class=fstrn>"+this.desc[1]
 		+ "</td></tr>"
		+ "<tr><td height=5 colspan=3><img src=\"images/clear.gif\" width=1 height=10></td></tr>"
 		+ "<tr><td>&nbsp;</td><td>&nbsp;</td><td class=fstrn>"	 		
 		+ this.pageLinks[0].render()+"</td></tr>"	
		+ "</form></table></td></tr><tr><td valign=bottom>"
		+ "<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td width=100% align=right valign=bottom class=fstrnsmall>"
		+ this.pageLinks[1].render()
		+ "<br><img src=\"images/clear.gif\" height=15></td><td width=100%>&nbsp;</td><td><img src=\"images/clear.gif\" width=15></td>"
		+ "</tr></table>"
		+ "</td></tr></table>";

	renderPage( pageFrame, getBody3(retStr) );
}



function renderConfirm( pageFrame )
{
	var formItemColor=(error)?"#CC0000":"#666666";
	tabIndex=1;

	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%><tr><td valign=top>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%>" + startForm
	+ "<tr><td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "<td valign=top class=fstrn bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=1 height=10><br>"+this.headLines[0]+"<br>"
	+ this.desc[0]+"<br><img src=\"images/clear.gif\" width=1 height=10></td>"
	+ "<td bgcolor=\"#FFFFCC\"><img src=\"images/clear.gif\" width=15></td>"
	+ "</tr></table>"
	+ "<img src=\"images/grayline.gif\" width=100% height=1><br>"
	+ "<table border=0 cellpadding=0 cellspacing=0 width=100%>"
	+ "<tr><td><img src=\"images/clear.gif\" width=15 height=40></td>"
	
	if( error )
 	{
		retStr += "<td valign=center>"
			+ (alert_image?"<img src=\"images/alerts/"+alert_image+"\" width=32 height=32>":"")
			+ "</td>"
			+ "<td><img src=\"images/clear.gif\" width=15></td>"
			+ "<td width=100% class=fstrnerror valign=center>"
			+ this.errorMessage[0]+"</td>";
 	}else{	 	
		retStr += "<td>&nbsp;</td>";
 	}
	
	retStr += "<td><img src=\"images/clear.gif\" width=15></td></tr></table>"
		+ "<TABLE border=0 cellpadding=0 cellspacing=0>";

	for( var i=0; i<this.formItems.length; i++ )
	{
		retStr += "<tr><td><img src=\"images/clear.gif\" width=15></td>"
			+ "<td width=40% class=fstrn nowrap align=right>"
			+ "<font color="
			+ ((this.formItems[i].error)?formItemColor:"#636363")+">"
			+ this.formItems[i].text+((this.formItems[i].required)?"*":"")+"</font></td>"
			+ "<td><img src=\"images/clear.gif\" width=15 height=10></td>"
			+ "<td class=fstrn width=60%>" + this.formItems[i].render()
			+ "</td><td><img src=\"images/clear.gif\" width=15></td></tr>";
	}
	
	retStr += "<tr><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td height=25 align=right valign=bottom class=fstrnsmall>"+this.desc[1]+"</td><td>&nbsp;</td><td>&nbsp;</td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td></tr>"				
		+ "</form></table></td></tr><tr><td valign=bottom>"
		+ "<table border=0 cellpadding=0 cellspacing=0><tr><td><img src=\"images/clear.gif\" width=15></td>"
		+ "<td width=100% align=right valign=bottom class=fstrnsmall>"
		+ this.pageLinks[0].render()
		+ "<br><img src=\"images/clear.gif\" height=15></td><td width=100%>&nbsp;</td>"
		+ "<td><img src=\"images/clear.gif\" width=15></td>"
		+ "</tr></table>"
		+ "</td></tr></table>";

	renderPage( pageFrame, getBody3(retStr) );
}

function renderWelcome( pageFrame )
{
	tabIndex=1;
	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>"
	 	+ "<tr><td valign=top class=fstrn><font class=fstrnbigblue>"+this.headLines[0]+"</font><br><br>"
 		+ "<font class=fstrnblue>"
		+ this.desc[0]+"<br><br>"
 		+ this.desc[1]+"<br>"
		+ this.desc[2]+"<br>"
		+ this.desc[3]+"<br>"
		+ this.desc[4]+"</font>"
		+ "</td></tr><tr><td valign=bottom class=fstrn>"
 		+ this.desc[5]+"<br><br>"
		+ this.desc[6]
 		+ "</td></tr>"
 		+"</table>"; 		
	renderPage( pageFrame, getBody2(retStr) );
}

function renderNag( pageFrame )
{
	tabIndex=1;
	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>"
	 	+ "<tr><td valign=top class=fstrn><font class=fstrnbigblue>"+this.headLines[0]+"</font><br><br>"
 		+ "<font class=fstrncolor>"
		+ this.desc[0]+"<br><br></font><font class=fstrnblue>"
 		+ this.desc[1]+"<br><br>"
		+ this.desc[2]+"<br><img src=\"images/clear.gif\" width=1 height=5><br>"
		+ "<li>"+this.desc[3]+"</li>"
		+ "<li>"+this.desc[4]+"</li>"
		+ "<li>"+this.desc[5]+"</li>"
		+ "<li>"+this.desc[6]+"</li><br><img src=\"images/clear.gif\" width=1 height=20><br></font>"
		+ this.desc[7]+"<br>"
		+ "</td></tr><tr><td valign=bottom class=fstrnsmall>"
		+ this.pageLinks[0].desc+" <a href=\"javascript:parent.window.showPage(\'"+ this.pageLinks[0].url +"\');\" "
		+ "tabindex="+(tabIndex++)+">"+this.pageLinks[0].text+"</a>"
 		+ "</td></tr>"
 		+ "</table>"; 	
	renderPage( pageFrame, getBody2(retStr) );
}

function renderOffline( pageFrame )
{
	tabIndex=1;
	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>"
	 	+ "<tr><td valign=top>"
		+ (alert_image?"<img src=\"images/alerts/"+alert_image+"\" width=32 height=32>":"")
		+ "</td>"
	 	+ "<td><img src=\"images/clear.gif\" width=15 height=1></td>"
		+ "<td valign=top class=fstrn>"+this.headLines[0]+"<br>"
 		+ this.desc[0]+"<br><br>"
 		+ "<font class=fstrnblue>"+this.desc[1]+"<br><br>"
		+ this.desc[2]+"</font>"
 		+ "</td></tr>"
		+ "<tr><td>&nbsp;</td><td>&nbsp;</td>"
		+ "<td valign=bottom class=fstrn>"
		+ this.pageLinks[0].render()	
		+ "<br><br>"+this.pageLinks[1].render()		
		+ "</td>"
		+ "</tr></table>"; 		

	renderPage( pageFrame, getBody(retStr) );
}

function renderForward( pageFrame )
{
	var plyrObj = parent.window.external;
	var web_url=plyrObj.PlayerProperty("hidden_web_url");
	var stream_url=plyrObj.PlayerProperty("hidden_stream_url");
	
	tabIndex=1;
	
	var retStr = "\n<script src=\"js/authsubmit.js\"></scr"+"ipt><form id=forward method=get target=\"_rpbrowser\" "
		+ "action=\"" + ((web_url=="")?"http://switchboard.real.com/player/login.html":web_url)+"\">"
		+ "<input type=hidden name=action value=\""+((LOGIN)?"login":"")+"\">"
		+ "<input type=hidden name=parameter value=\""+ plyrObj.PlayerProperty("signinparam")+"\">"
		+ "</form><script>"
		+ "var sendit = setTimeout(\"submitMe(\'"+pageFrame.name+"\')\",500);"
		+ "</scr"+"ipt>";
	renderPage( pageFrame, getBody(retStr) );
}

function renderContacting( pageFrame )
{	
	contactingPage = true;	
	tabIndex=1;
	var retStr = ""
		+ "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>"
		+ "<tr><td class=fstrng align=center valign=top width=100%>"
		+ "<img src=\"images/clear.gif\" height=115 width=1><br>"
		+ "<img src=\"images/conn_anim.gif\" border=0 width=335 height=60><br>"
		+ "<img src=\"images/clear.gif\" height=15 width=1><br>"
		+ "<img src=\"http://static.realone.com/g/pics/space.gif\" width=0 height=0 style=\"visibility:hidden\">";
		if (plyrObj.PlayerProperty("configurationcomplete") != 1){
			retStr += pages["connect"].desc[0];
		}else{
			retStr += pages["connect"].desc[1];	
		}
		retStr += "</td></tr></table>";
	renderPage( pageFrame, getConnectBody(retStr) );
}

function renderGenError( pageFrame)
{
	tabIndex=1;
	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>"
	 	+ "<tr><td valign=top><img src=\"images/alerts/"+alert_image+"\" width=32 height=32></td>"
	 	+ "<td><img src=\"images/clear.gif\" width=15 height=1></td>"
		+ "<td valign=top class=fstrn>"+this.headLines[0]+"<br>"
 		+ this.desc[0]+"<br><br>"
 		+ "<font class=fstrnblue>"+this.desc[1]+"</font>"
 		+ "</td></tr>"
		+ "<tr><td>&nbsp;</td><td>&nbsp;</td>"
		+ "<td valign=bottom class=fstrn>"
		+ this.pageLinks[0].render()	
		+ "<br><br>"+this.pageLinks[1].render()
		+ "</td>"
		+ "</tr></table>"; 
	
	renderPage( pageFrame, getBody(retStr) );
}

function renderCancel( pageFrame)
{
	tabIndex=1;	
	var retStr = "<table border=0 cellpadding=0 cellspacing=0 height=100% width=100%>"
	 	+ "<tr><td valign=top><img src=\"images/alert_icon.gif\" width=32 height=32></td>"
	 	+ "<td><img src=\"images/clear.gif\" width=15 height=1></td>"
		+ "<td valign=top class=fstrn>"
 		+ this.desc[0]+"<br><br>"
 		+ "</td></tr>"
		+ "</table>"; 
	renderPage( pageFrame, getBody(retStr) );
}

var bodyFrame;
var bodyData = "";
function renderPage( pageFrame, data )
{
	bodyFrame=pageFrame;
	bodyData = data;
	pageFrame.document.clear();
	pageFrame.document.open("text/html","replace");
	pageFrame.document.write( bodyData );
	pageFrame.document.close();
	setTimeout("getFocus();",300);
}

function getFocus()
{
	pageFrame=bodyFrame;
	if( pageFrame.document.readyState != "complete" )
	{
		setTimeout("getFocus();",500);
	}
	var flag=false;
	
	if( pageFrame.document.forms.length>0 && pageFrame.document.forms[0].length>0 )
	{
		var i=0;
		for( var i=0; i<pageFrame.document.forms[0].length; i++ )
		{
			if( pageFrame.document.forms[0][i].type!="hidden" )
			{
				pageFrame.document.forms[0][i].focus();
				focusItem=pageFrame.document.forms[0][i];
				break;
			}
		}
	}else{
		var lnkCnt = pageFrame.document.links.length;
		var lnkAry = pageFrame.document.links;
		for( var i=0; i<lnkCnt; i++ )
		{
			if( lnkAry[i].tabindex && lnkAry[i].tabindex==0 )
			{
				lnkAry[i].focus();
				return;
			}
		}
	}
}

function renderButtons(buttonArray)
{
	var buttonArray = parent.currentPage.buttons;
	
	var retStr = "<table align=right border=0 cellpadding=0 cellspacing=3 height=30>";
	var btnRow = "<tr>";
	for( var i=0,j=tabIndex+buttonArray.length-1; i<buttonArray.length; i++,j-- )
	{
		btnRow += "<td height="+button_height+" width="+button_width+" align=center valign=middle style=\"height:"+button_height+"px; overflow:hidden\""
				+ "><div style='position:relative; overflow:hidden; width:100%; height:100%;'>"
				+ "<a href=\"#\" onclick=\"javascript:sendEvent('"+buttonArray[i].action+"');return false;\" tabindex=\""+j+"\""
				+ "><span style=\"height:"+button_height+"px;width:"+button_width+"px;cursor:default;\""
				+ "><table border=0 cellpadding=0 cellspacing=0 width=100% height=100% "
				+ "><tr><td align=center valign=middle "
				+ " orig=\""+buttonArray[i].action+"\" id=\""+buttonArray[i].action+"\" class=btnBack"
				+ "><font color=666666 orig=\""+buttonArray[i].action+"\" class=btnText>"
				+ buttonArray[i].text
				+ "</font></td></tr></table></span></a></div></td>";
	}
		btnRow += "<td>&nbsp;</td></tr>";
	retStr += btnRow + "</table>"+iconOBJ;
	return retStr;
}

function renderConnectButtons(buttonArray)
{
	var buttonArray = parent.pages["connect"].buttons;

	var retStr = "<table align=right border=0 cellpadding=0 cellspacing=3 height=30>";
	var btnRow = "<tr>";
	for( var i=0,j=tabIndex+buttonArray.length-1; i<buttonArray.length; i++,j-- )
	{
		if (buttonArray[i].id == "back" && prevLength == 0)
		{
		}else{

		btnRow += "<td height="+button_height+" width="+button_width+" align=center valign=middle style=\"height:"+button_height+"px; overflow:hidden\""
				+ "><div style='position:relative; overflow:hidden; width:100%; height:100%;'><a href=\"#\" onclick=\"javascript:sendEvent('"+buttonArray[i].action+"');return false;\" tabindex=\""+j+"\""
				+ "><span style=\"height:"+button_height+"px;width:"+button_width+"px;cursor:default;\""
				+ "><table border=0 cellpadding=0 cellspacing=0 width=100% height=100% "
				+ "><tr><td align=center valign=middle "
				+ " orig=\""+buttonArray[i].action+"\" id=\""+buttonArray[i].action+"\" class=btnBack"
				+ "><font color=666666 orig=\""+buttonArray[i].action+"\" class=btnText>"
				+ buttonArray[i].text
				+ "</font></td></tr></table></span></a></div></td>";
		}
	}
		btnRow += "<td>&nbsp;</td></tr>";
	retStr += btnRow + "</table>"+iconOBJ;
	return retStr;
}

var off_render_loaded = true;

