/**
* Methods specific for Casino
*
* @author Sebastien Ben m'Barek
*/

/**************************************************************************
 	Private Functions
 **************************************************************************/
function getHeaderFrame() {
	return top.frames['header'];
}

function getContentFrame() {
	return top.frames['Content'];
}

function interface_joinNow() {
	var oFrame = getHeaderFrame();
	if (oFrame != null && oFrame.spawn) {
		oFrame.spawn('joinNow');
	}
}

/**************************************************************************
 	Public Functions
 **************************************************************************/
function openWindow(href) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(href, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=1200,height=800,left = 390,top = 262');");
}

function playGame(gameId, gameName, type) {
	var oFrame = getContentFrame();
	if (oFrame != null && oFrame.spawn) {
		oFrame.playGame(gameId, gameName, type);
	}
}

function playRealGameNoMatter(gameId, gameName, type) {
 var oFrame = getContentFrame();
 if (oFrame != null && oFrame.spawn) {
  oFrame.playRealGameNoMatter(gameId, gameName, type);
 }
}
 
function playFunGameNoMatter(gameId, gameName, type) {
 var oFrame = getContentFrame();
 if (oFrame != null && oFrame.spawn) {
  oFrame.playFunGameNoMatter(gameId, gameName, type);
 }
}


function goJoinNow(){
	interface_joinNow();
}

function displayMainLounge(){
	document.getElementById("mainLoungeDiv").style.display = "block";
	document.getElementById("zeroLoungeDiv").style.display = "none";
	document.getElementById("mainLoungeImg").src = "/images/en_GB/casino/main_lounge_focus.gif";
	document.getElementById("zeroLoungeImg").src = "/images/en_GB/casino/zero_lounge.gif";
}

function displayZeroLounge(){
	document.getElementById("mainLoungeDiv").style.display = "none";
	document.getElementById("zeroLoungeDiv").style.display = "block";
	document.getElementById("mainLoungeImg").src = "/images/en_GB/casino/main_lounge.gif";
	document.getElementById("zeroLoungeImg").src = "/images/en_GB/casino/zero_lounge_focus.gif";
}

function openLobby(href, target) {
	var url = top.domainManager.constructUrl('casino', false) + "/Lobby.do";
	var oFrame = getContentFrame();
	if (oFrame != null && oFrame.spawn) {
		oFrame.openLobby(url);
	}
}
