/** JAVASCRIPT: casino-full-screen-script */

/**
* Controlls "enlarge" button in the instant play casino. It also tracks the
* number of times the button was pressed by the user via site calatylst. 
*
* @author Andrey Soubbotin (asoubbotin@riptown.com)
*/


var idName = 'small';
var isDenom = true;

/**
* Displays the alert dialog.
*
* @param	nameTxt	information to display
*/
function showAlertDialog(nameTxt)
{	
	alert(nameTxt);
}
/**
* Toggles the game from "normal" to "full screen" and back.
*/
function enlargeGame()
{
	// reference to the "enlarge" button 
	var buttonImage = document.getElementById("button-enlarge");
	
	// Determine whether we are using game with denominations or not
	if(document.getElementById("game-left-border"))
	{
		isDenom = false;	// denominations are not used
		
		var leftBorder = document.getElementById("game-left-border");
		var rightBorder = document.getElementById("game-right-border");
		// flash game wrapper div
		var casinoGameContainer = document.getElementById("game-container");
		
	}
	else
	{
		isDenom = true;		// denominations are used
		
		var leftBorder = document.getElementById("game-left-border-withdenoms");
		var rightBorder = document.getElementById("game-right-border-withdenoms");
		// flash game wrapper div
		var casinoGameContainer = document.getElementById("game-container-withdenoms");
	}	
	
	// element containing the games menu	
	var instantPlayMenu = document.getElementById("instant-play-menu");	
	// main window containing the game and the header in it
	var casinoGameLeftColumn = document.getElementById("instant-play-left-column");	
	// div where the swf game is loaded	
	var casinoGame = document.getElementById("flash-game");
	
	// switch class id	
	if(idName == 'small')
	{
		// go to "full screen mode"
		idName = 'large';
		
		buttonImage.src = '/images/casino/instant-play/button-minimize-off.gif';				
		casinoGameLeftColumn.style.width = '100%';
		
		if(isDenom)
		{
			casinoGameLeftColumn.style.height = '810px';
			
			casinoGameContainer.className = 'game-container-withdenoms-full-screen';
			casinoGame.className = 'flash-game-full-screen';
			
			var denominationBar = document.getElementById("flash-game-denominations");
			denominationBar.style.margin = '5px 0pt 0pt 100px';
			
			// game contains denominations	
			rightBorder.style.height = '607px';
			leftBorder.style.height = '607px';
			casinoGameContainer.style.height = '607px';

		}
		else
		{	
			rightBorder.style.height = '560px';
			leftBorder.style.height = '560px';	
	
			casinoGameContainer.className = 'game-container-full-screen';
			casinoGame.className = 'flash-game-full-screen';		
		}	
		
		instantPlayMenu.style.display = 'none';		
	}
	else	
	{
		// go to "normal screen mode"		
	
		idName = 'small';		

		buttonImage.src = '/images/casino/instant-play/button-enlarge.gif';
		
		if(isDenom)
		{
			casinoGameLeftColumn.style.height = '760px';
			
			var denominationBar = document.getElementById("flash-game-denominations");
			denominationBar.style.margin = '5px 0pt 0pt 13px';
			
			casinoGameContainer.style.height = '450px';
			rightBorder.style.height = '450px';
			leftBorder.style.height = '450px';
		}
		else
		{	
			rightBorder.style.height = '410px';
			leftBorder.style.height = '410px';
		}
		
		casinoGameLeftColumn.style.height = '';
		casinoGameLeftColumn.style.width = '561px';
		casinoGameContainer.className = 'game-container';
		casinoGame.className = 'flash-game';
		
		instantPlayMenu.style.display = 'block';		
	}	
}