var lastPopUpWindow = null;

function pop(sCase) {
// close the last pop-up.
	try {
		lastPopUpWindow.close();
	}catch(e){
	}
	switch(sCase) {
		case "register":
			window.open('https://register.go.com/touchstone/turok/index');
			doTracking("REGISTER");
			urchinTracker("register");
			break;
			
		case "news":
			//lastPopUpWindow = launchPopUpWindow('news.html?newsId=' + pop.arguments[1], 'news', 772, 586, 5, 1);
			//alert('clicked');
			window.open('assets/data/news/news_20071002_actors.pdf');
			break;
			
		// External links
		case "preorder":
			window.open('http://www.gamestop.com/productmerch.asp?groupid=851&affid=9550');
			break;
		case "register":
			window.open('https://register.go.com/touchstone/turok/index');
			break;
			
		// Downloads
		case "wallpaper":
			void(mywin=window.open('wallpaper.html?id=' + pop.arguments[1] + '&width=' + pop.arguments[2], 'wallpaper','width=850,height=800,top=40,left=40,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no'));
			mywin.focus();
			break;
		case "screensaver":
			lastPopUpWindow = launchPopUpWindow('download.html?theFile=Turok_ss_' + pop.arguments[1] + '.zip', 'download', 770, 335);
			break;
		case "buddy_icons":
			lastPopUpWindow = launchPopUpWindow('buddy_icons.html', 'buddy_icons', 340, 525);
			break;
		default:
			alert('Unimplemented pop-up.  Code: '+sCase);
			break;
	}
}