// when movies require login info... they ask for it. 
// after receiveing it, they authenticate it
// if ok, proceed, 
// if not... resetLoginInfo and ask for it again.

var JSUsername="";
var JSPassword="";
var JSWorking = false;
var JSLoginOK = false;

function openLogin()
{
	//alert("openLogin");
var obj = document.getElementById("loginID");
if (obj)
{
	document.form_login.submit();
	//obj.style.display="";
}
}
function closeLogin()
{
var obj = document.getElementById("loginID");
if (obj)
{
	JSWorking = false;
	//JSUsername = "";
	//JSPassword = "";
	obj.style.display="none";
}
}

function drawLoginDiv()
{
	var html="";
	html+='<form name="form_login" target="iframe_name" action="clube/login.html" method="get"></form>';
	html+='<div id="loginID" style="display:none; position:absolute;top:106px; width:100%;z-index:10;" align="center">';
	html+='<table width="1000" align="center" border="0">';
	html+='<tr>';
	html+='<td class="principal" height="334" align="center">';
	html+='<iframe id="iframe_id" name="iframe_name" src="clube/login.html" scrolling="no" style="width:728px;height:334px;" frameborder="0" marginheight="0" marginwidth="0"></iframe>';
	html+='</td>';
	html+='</tr>';
	html+='</table>';
	html+='</div>';
	return(html);
}


function openGame()
{
	//window.open("http://gombby.local.pt/jogo.html");
var obj = document.getElementById("jogoID");
//alert(obj);
if (obj)
{
   // alert(obj);
	obj.style.display="";  
}
var objGame = document.getElementById("Frmjogo");
if (objGame)
{
	//alert(obj);
    objGame.src="jogo.html";
}

}

function closegameparent()
{
var obj = document.getElementById("jogoID");
if (obj)
{
	obj.style.display="none";
}
var objGame = document.getElementById("Frmjogo");
if (objGame)
{
	objGame.src="blank.html";
}
}

function drawGameDiv()
{
	var html="";
	
	html+='<form name="form_game" target="iframe_name" action="jogo.html" method="get"></form>';
	html+='<div id="jogoID" style="display:none; position:absolute;top:106px; width:100%;z-index:10;" align="center">';
	html+='<table width="630" align="center" border="0" bgcolor="#FFFFFF">';
	html+='<tr>';
	html+='<td class="principal" align="center">';
	html+='<iframe id="Frmjogo" name="Frmjogo" src="jogo.html" scrolling="no" style="margin-top:20px;width:728px;height:440;" frameborder="0" marginheight="0" marginwidth="0"></iframe>';
	html+='</td>';
	html+='</tr>';
	html+='</table>';
	html+='</div>';
	return(html);
}
/* ************************************************ */
function ResetLoginInfo()
{
	JSUsername="";
	JSPassword="";
}

function GetLoginInfo()
{
//	alert(JSLoginOK);
	//alert(JSUsername+";"+JSPassword);
	if (JSLoginOK) return(JSUsername+";"+JSPassword);
	else return("");
}

function GetLoginUsername()
{
	return(FSUsername);
}
function GetLoginPassword()
{
	return(FSPassword);
}
function SendLoginInfoToFlash(username, password)
{
	var obj = thisMovie("flashmovie");
	if (obj)
	{
		JSUsername = username;
		JSPassword = password;
		obj.SendLoginInfoToFlash(username, password);
	}
}

function thisMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

/* ********************************************* */
function SetLoginInfoOK(u, p)
{
	JSLoginOK = true;
	JSUsername = u;
	JSPassword = p;
	return(true);
}


function OpenConcurso()
{
	var nwindow = window.open("concurso/index.html", "concurso", "toolbar=0, menubar=0, resizable=no, width=600, height=576");
}
