
function flowfs( ctx, game, debug )
{
	var url = ctx + "/games/flow.action";
	
	if( game )
	{
		url = url + "?game=" + game;
	}
	
	if( debug )
	{
		if( game ) 
		{
			url += "&";
		}
		else
		{
			url += "?";
		}
		url += "debug=true";
	}
	
	fullScreen( url, window );
}


function gamefs( ctx, game, topics, level, auto ) 
{
	var url = ctx + "/games/play.action?game=" + game;
	
	if( topics )
	{
		url += "&topics=" + topics;
	}		

	if( level )
	{
		url += "&level=" + level;
	}	
	
	if( auto )
	{
		url += "&auto=true";
	}
	
	fullScreen( url, window );
	
	return false;
}

function fullScreen( url, opener )
{
	var opened = null;
	if( $.browser.msie )  
	{
		if( new Number($.browser.version) >= 6 )
		{
			opened = opener.open( url, '', 'fullscreen=yes, scrollbars=auto, resizable=yes' );
		}
		else
		{
			setTimeout( function() { alert( "You need Internet Explorer version 6 or greater for this content." ); }, 100 );
		}
	}
	else
	{
		opened = opener.open( url, '', 'width=' + (screen.width-5) + ',height=' + (screen.height-30) + ', scrollbars=auto, resizable=yes, ' );				
	}
	
	if( opened==null )
	{
		setTimeout( function () { alert( "Your browser blocked the popup window SumDog.com uses to display this content. Please allow popups for SumDog.com" ); }, 100 );
		return false;
	}
	
	if( window.focus )
	{
		opened.focus();
	}
	
	if( opened.opener == undefined || opened.opener == null )
	{
		opened.opener = opener;
	}
	
}