window.onload = function(){
	addCloseEvent();
}

function addCloseEvent(){
	var close = document.getElementById('close');
	if(close){
		close.onclick = function(){
			window.close();
		}
	}
}

function gamePopup(game){
	var url = null;
	var w = null;
	var h = null;

	switch(game){
		case 'foodcatcher':
			url = '../games/foodcatcher/index.html';
			w = 606;
			h = 465;
			break;
		case 'weeklyforecast':
			url = '../games/weeklyforecast/index.html';
			w = 606;
			h = 465;
			break;
		case 'stickerstudio':
			url = '../stickerstudio.html';
			w = 874;
			h = 639;
			break;
	}

	if(url){
		if(!window.open(url,'_blank','width='+w+',height='+h+'scrollbars=0;status=0,toolbar=0,location=0,menubar=0')){
			alert('Your popup blocker is preventing this page from opening');
		}
	}
}