function open_nintendo()
{
	// code to place the pop up window in the centre of the screen.
	var width = 780;
	var height = 450;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("http://www.nintendo-europe.com","Nintendo","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=780,height=450,top=" + y + ",left=" + x);
			
		}
		
function open_gameboy()
{
	// code to place the pop up window in the centre of the screen.
	var width = 780;
	var height = 450;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("http://www.gameboyadvance.com/choose.jsp","Gameboy","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550,top=" + y + ",left=" + x);
			
		}
		
function open_tmt()
{
	// code to place the pop up window in the centre of the screen.
	var width = 350;
	var height = 380;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var credits = window.open("http://pokegames.nintendo-europe.com/flash/uk/site_credits.htm","credits","toolbar=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=no,width=350,height=380,top=" + y + ",left=" + x);
			
		}


function popupPokedex(lng, be)
{
	// code to place the pop up window in the centre of the screen.
	var width = 640;
	var height = 340;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	
	//Tempor?
	if(lng == "nlNL") var lng = "nl";
	else if(lng == "nlBE") var lng = "nlb";
	else if(lng == "frFR") var lng = "fr";
	else if(lng == "frBE") var lng = "frb";
	else if(lng == "enGB") var lng = "en";
	else if(lng == "itIT") var lng = "it";
	else if(lng == "deDE") var lng = "de";
	else if(lng == "esES") var lng = "es";
	else var lng = "en";
	//----


	var open_it = window.open("../shared/static/popups/pokedex.php?language=" + lng,"Pokedex","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=640,height=340,top=" + y + ",left=" + x);

	//var open_it = window.open("http://pokegames.nintendo-europe.com/pokedex/pokedex.asp?language=" + lng,"Pokedex","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=640,height=340,top=" + y + ",left=" + x);
	
}

function popupSinnohPokedex(lng, be)
{
	// code to place the pop up window in the centre of the screen.
	var width = 880;
	var height = 500;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	
	//Tempor?
	if(lng == "nlNL") var lng = "nl";
	else if(lng == "nlBE") var lng = "nl";
	else if(lng == "frFR") var lng = "fr";
	else if(lng == "frBE") var lng = "fr";
	else if(lng == "enGB") var lng = "en";
	else if(lng == "itIT") var lng = "it";
	else if(lng == "deDE") var lng = "de";
	else if(lng == "esES") var lng = "es";
	else var lng = "en";
	//----

	var open_it = window.open("../shared/user/sinnoh_pokedex/" + lng + "/index.html","SinnohPokedex","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=880,height=500,top=" + y + ",left=" + x);

	//var open_it = window.open("http://pokegames.nintendo-europe.com/pokedex/pokedex.asp?language=" + lng,"Pokedex","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=640,height=340,top=" + y + ",left=" + x);
	
}

function open_nintendo()
{
	// code to place the pop up window in the centre of the screen.
	var width = 780;
	var height = 450;
	var screenX = screen.width


	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("http://www.nintendo-europe.com","Nintendo","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=780,height=450,top=" + y + ",left=" + x);
			
		}
		
function open_gameboy()
{
	// code to place the pop up window in the centre of the screen.
	var width = 780;
	var height = 450;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("http://www.gameboyadvance.com/choose.jsp","Gameboy","toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550,top=" + y + ",left=" + x);
			
		}
		
function open_vip()
{
	// code to place the pop up window in the centre of the screen.
	var width = 400;
	var height = 320;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("http://pokegames.nintendo-europe.com/vip.htm","vip","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=400,height=320,top=" + y + ",left=" + x);
			
		}
		
function open_poll(lng)
{
	// code to place the pop up window in the centre of the screen.
	var width = 418;
	var height = 360;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

		//Tempor?
	/*if(lng == "nlNL") var lng = "nl";
	else if(lng == "nlBE") var lng = "nl";
	else if(lng == "frFR") var lng = "fr";
	else if(lng == "frBE") var lng = "fr";
	else if(lng == "enGB") var lng = "uk";
	else if(lng == "itIT") var lng = "it";
	else if(lng == "deDE") var lng = "de";
	else var lng = "uk";*/
	//----

	var open_it = window.open("../shared/poll.php?language="+lng,"pokepolls_polls","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+" ,height="+height+",top=" + y + ",left=" + x);
			
		}
		
function open_archive(lng)
{
	// code to place the pop up window in the centre of the screen.
	var width = 418;
	var height = 360;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

		//Tempor?
	/*if(lng == "nlNL") var lng = "nl";
	else if(lng == "nlBE") var lng = "nl";
	else if(lng == "frFR") var lng = "fr";
	else if(lng == "frBE") var lng = "fr";
	else if(lng == "enGB") var lng = "uk";
	else if(lng == "itIT") var lng = "it";
	else if(lng == "deDE") var lng = "de";
	else var lng = "uk";*/
	//----

	var open_it = window.open("../shared/poll.php?language="+lng+"&archivList=1","pokepolls_archive","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",top=" + y + ",left=" + x);
			
		}
		
function open_tmt(lng)
{
	// code to place the pop up window in the centre of the screen.
	var width = 350;
	var height = 380;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

		//Tempor?
	if(lng == "nlNL") var lng = "nl";
	else if(lng == "nlBE") var lng = "nl";
	else if(lng == "frFR") var lng = "fr";
	else if(lng == "frBE") var lng = "fr";
	else if(lng == "enGB") var lng = "uk";
	else if(lng == "itIT") var lng = "it";
	else if(lng == "deDE") var lng = "de";
	else var lng = "uk";
	//----

	var credits = window.open("http://pokegames.nintendo-europe.com/flash/"+lng+"/site_credits.htm","credits","toolbar=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=no,width=350,height=380,top=" + y + ",left=" + x);
			
		}

function open_game(lng)
{
	// code to place the pop up window in the centre of the screen.
	var width = 620;
	var height = 460;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

		//Tempor?
	if(lng == "nlNL") var lng = "nl";
	else if(lng == "nlBE") var lng = "nl";
	else if(lng == "frFR") var lng = "fr";
	else if(lng == "frBE") var lng = "fr";
	else if(lng == "enGB") var lng = "uk";
	else if(lng == "itIT") var lng = "it";
	else if(lng == "deDE") var lng = "de";
	else var lng = "uk";
	//----

	var open_it = window.open("http://pokegames.nintendo-europe.com/flash/"+lng+"/competition_game/player.asp?language="+lng,"comp_game","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width="+width+" ,height="+height+",top=" + y + ",left=" + x);
}

function open_mini_game(lng)
{
	open_pokemon_game(lng, 3);

}

function open_pokemon_game(lng, gameNum)
{
	// code to place the pop up window in the centre of the screen.
	var width = 720;
	var height = 520;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("../shared/static/swf/games/game"+gameNum+".php?language="+lng,"mini_game","toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width="+width+" ,height="+height+",top=" + y + ",left=" + x);
	return;

}
		
function open_register(pagelink) {
	// code to place the pop up window in the centre of the screen.
	var width = 300;
	var height = 300;
	var screenX = screen.width
	var screenY = screen.height

	var x = screenX - width - 150;
	var y = screenY - height - 250;

	if (x < 0) {
		x = 0;
	}
	if (y < 0) {
		y = 0;
	}

	window.open(pagelink,"registerpop", "toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ", top=" + y + ", left=" + x);
}



function open_character(lng, file, name)
{
	// code to place the pop up window in the centre of the screen.
	var width = 730
	var height = 450;
	var screenX = screen.width
	var screenY = screen.height
	
	var adjust = 20;
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2 - adjust;

	var open_it = window.open("../shared/static/popups/gallery.php?language=" + lng + "&file=" + file + "&name="+name,"gallery_"+name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=730,height=450,top=" + y + ",left=" + x);
			
}

function launch_pinball(country)
{
	/*if (country=="uk") {
		country_url_1 = "en";
		country_url_2 = "GB"
	}
	else {
		country_url_1 = country.toLowerCase();
		country_url_2 = country.toUpperCase();
	}
	country_url = country_url_1 + country_url_2;
	*/
	country_url = country;
	
	// code to place the pop up window in the centre of the screen.
	var width = 785
	var height = 570;
	var screenX = screen.width
	var screenY = screen.height
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2;
	if (country_url == "esES") {
		var url = "http://www.nintendo-europe.com/NOE/es/ES/games/gamepage.do?ElementId=2f83b556-81a0-4a6d-837f-e43acb9bc983&";
		var pinball = window.open(url,"pinball_" + country_url,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x);

	} else {
		var url = "http://www.nintendo-europe.com/microsite/pokemonpinball/" + country_url + "/";
		var pinball = window.open(url,"pinball_" + country_url,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x);
	}
}

function launch_colosseum(country)
{
	/*if (country=="uk") {
		country_url_1 = "en";
		country_url_2 = "GB"
	}
	else if (country=="frBE") {
		country_url_1 = "fr";
		country_url_2 = "BE"
	}
	else if (country=="nlBE") {
		country_url_1 = "nl";
		country_url_2 = "BE"
	}
	else {
		country_url_1 = country.toLowerCase();
		country_url_2 = country.toUpperCase();
	}
	country_url = country_url_1 + country_url_2;
	*/
	country_url = country;
	
	// code to place the pop up window in the centre of the screen.
	var width = 770
	var height = 570;
	var screenX = screen.width
	var screenY = screen.height
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2;

	var colosseum = window.open("http://www.nintendo-europe.com/microsite/pokemoncolosseum/" + country_url + "/flashhome.html","colosseum_" + country_url,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x);
}

function launch_emerald(country)
{
	country_url = country;
	
	// code to place the pop up window in the centre of the screen.
	var width = 869;
	var height = 726;
	var screenX = screen.width
	var screenY = screen.height
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2;

	var url = "http://ms.nintendo-europe.com/pokemonemerald/" + country_url + "/";
	var pinball = window.open(url,"emerald_" + country_url,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x);
}
function launch_xd(country)
{
	country_url = country;
	
	// code to place the pop up window in the centre of the screen.
	var width = 869;
	var height = 726;
	var screenX = screen.width
	var screenY = screen.height
	
	var x = (screenX - width)/2;
	var y = (screenY - height)/2;

	var url = "http://ms.nintendo-europe.com/pokemonxd/" + country_url + "/";
	var pinball = window.open(url,"dx_" + country_url,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",top=" + y + ",left=" + x);
}
function wopen(url, target, params)
{
	var w = window.open(url, target, params);
}