function showGameHistory(gid, q)
{
	var v = -1;
	var w = 585
	var h = 450;

	if ((gid > 3 && gid < 10) /*|| (gid > 13 && gid < 20)*/)
	{
		v = gid - 3;
		gid = 4;
	}
	if (gid > 12 && gid <16)
	{
		w = 760;
		h = 420;
	}
	var so = null;
	so = new SWFObject("./history/"+gid+".swf", "gameview", w, h, "9", "#FFFFFF");


	so.addVariable("q",q);
	so.addVariable("gameHistoryString",q);
	if (-1 < v) so.addVariable("v", v);
	so.write("gameholder");
}

function openRules(game)
{
	var rurl = 'rules.php?game='+game+'';
	openWin(rurl,1);
}

function openCasher()
{
	var curl = 'casher.php';
	openWin(curl,0);
}

function openWin(surl,tb)
{
	var w = parseInt(screen.availWidth*0.6), h = parseInt(screen.Width*0.45);
	var x = parseInt((screen.availWidth - w) / 2), y = parseInt((screen.availHeight - h) /2);
	window.open(surl, 'rules', 'menubar=0,status=1,resizable=0,top=' + y + ',height=' + h + ',left=' + x + ',width=' + w + ',location=0,toolbar=0,scrollbars='+tb+'').focus();
}

function openGame(game,mode,minbet,table, w, h)
{
	var wurl = ''+game+'?minbet='+minbet+'&table='+table+'&mode='+mode+'';

	if ('undefined' == typeof w || 'undefined' == typeof h)
	{
		w = parseInt(screen.width*0.85);
		h = parseInt(screen.width*0.6375);
	}
	wurl+='&w='+w+'&h='+h;
	var x = parseInt((screen.width - w) / 2), y = parseInt((screen.height - h) / 4);
	window.open(wurl, 'pari', 'menubar=0,status=1,resizable=1,top=' + y + ',height=' + h + ',left=' + x + ',width=' + w + ',location=0,toolbar=0,scrollbars=0').focus();
}

function openReg(rurl)
{
	var w=760, h=500;
	var x = parseInt((screen.width - w) / 2), y = parseInt((screen.height - h) / 2);
	window.open(rurl, 'reg', 'menubar=0,status=1,resizable=0,top=' + y + ',height=' + h + ',left=' + x + ',width=' + w + ',location=0,toolbar=0,scrollbars=1').focus();
}

function addcash() { if (opener && opener.document) { opener.refCash(); }}
function refCash() { intro.setVariable("_root.menu.cashvis","222"); }
