// Arcade popups
//var win1 = null;
//var win2 = null;
function Gk_PopTart(mypage,myname,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
  win1 = window.open(mypage,myname,settings);
}
function Trophy_Popup(mypage,myname,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
  win2 = window.open(mypage,myname,settings);
}

// Chat login
function chatLogin() {
	// The size of the popup window
	var width = 800;
	var height = 600;

	// The x,y position of the popup window
	// NOTE: this formula will auto-center the popup on the screen
	var y = (screen.height - height) / 2;
	var x = (screen.width - width) / 2;

	var options = 'width=' + width + ',height=' + height + ',top=' + y + ',left=' + x + ',resizable';

	// Open the chat window as a popup, instead of embedded in webpage
	window.open( 'chat/flashchat.php', 'chat', options );
}

// Log out confirmation
function logout_question()
{
	body_self = document.getElementsByTagName('body');
	body_self[0].style.filter = 'Alpha(opacity="60")';
	body_self[0].style.MozOpacity = '0.6';
	body_self[0].style.opacity = '0.6';
	if (confirm('You are about to logout'))
	{
		body_self[0].style.filter = 'Alpha(opacity="100")';
		body_self[0].style.MozOpacity = '1';
		body_self[0].style.opacity = '1';
		return true;
	} else {
		body_self[0].style.filter = 'Alpha(opacity="100")';
		body_self[0].style.MozOpacity = '1';
		body_self[0].style.opacity = '1';
		return false;
	}
}

// Hide loading page
function hideLoadingPage() {
	if (document.getElementById) {  // DOM3 = IE5, NS6
		document.getElementById('hidepage').style.visibility = 'hidden';
		document.getElementById('showpage').style.visibility = 'visible';
	} else {
		if (document.layers) {  // Netscape 4
			document.hidepage.visibility = 'hidden';
			document.showpage.visibility = 'visible';
		} else {  // IE 4
			document.all.hidepage.style.visibility = 'hidden';
			document.all.showpage.style.visibility = 'visible';
		}
	}
}
