
	function openGame(game, url)
	{
		var left = (screen.width/2)-(950/2);
		var top =  (screen.height/2)-(675/2);
		var newWindow = window.open(url, game, "resizable=1,status=0,menubar=0,scrollbars=0,toolbar=0,location=0,width=950,height=675");
		newWindow.focus();
	}
	function openGameBJ(gamebj, urlbj)
	{
		var leftbj = (screen.width/2)-(950/2);
		var topbj = (screen.height/2)-(712/2);
		var newWindow = window.open(urlbj, gamebj, "resizable=1,status=0,menubar=0,scrollbars=0,toolbar=0,location=0,width=950,height=712");
		newWindow.focus();
	}
	function openGameEG(gameEG, urlEG) {
		var left = (screen.width/2)-(950/2);
		var top =  (screen.height/2)-(675/2);
		var newWindow = window.open(urlEG, 'EG', "resizable=1,status=0,menubar=0,scrollbars=0,toolbar=0,location=0,width=950,height=675");
		newWindow.focus();
	}


jQuery(document).ready(function() {

	var loaded = null;
	pathArray = window.location.pathname.split( '/' );
	pathProcess = "";
	for ( i = 0; i<=pathArray.length; i++ ) {
	pathProcess += "../";
	}
	urlProcess = pathProcess + "process.php";
	
	urlRedir = window.location.protocol + "//" + window.location.host + "/"


	//Default Action
	$(".games_content").hide(); //Hide all content
	$("ul.menugames li:first").addClass("active").show(); //Activate first tab
	$(".games_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.menugames li").click(function() {
		$("ul.menugames li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".games_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

	$("ul.menugames-demo li:first").addClass("active").show(); //Activate first tab
	//On Click Event
	$("ul.menugames-demo li").click(function() {
		$("ul.menugames-demo li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".games_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});



	$('#create_account').hide();

	$('#create_a').click(function() {
		$('#create_account').slideDown('slow');
		return false;
	});

	$('#create_a_close').click(function() {
		$('#create_account').slideUp('fast');
		return false;
	});


	$("#create_a2").click(function(){
		$('#create_account').slideDown('slow');
		return false;
	});

	$("#create_a3").click(function(){
		$('#create_account').slideDown('slow');
		return false;
	});

	$("#create_a4").click(function(){
		$('#create_account').slideDown('slow');
		return false;
	});

	$("#create_a5").click(function(){
		$('#create_account').slideDown('slow');
		return false;
	});




	$('#baccarat-button')
		.button()
		.click(function() {
			$("LGames").addClass("show");
			$('#baccarat-dialog-box').dialog('open');
	});

	$('#blackjack-button')
		.button()
		.click(function() {
			$("LGames").addClass("show");
			$('#blackjack-dialog-box').dialog('open');
	});

	$('#roulette-button')
		.button()
		.click(function() {
			$("LGames").addClass("show");
			$('#roulette-dialog-box').dialog('open');
	});





});
