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);
			break;
			
		// External links
		case "preorder":
			window.open('http://www.gamestop.com/productmerch.asp?groupid=851&affid=9550');
			break;
		case "bestbuy":
			window.open('http://www.bestbuy.com/site/olspage.jsp;jsessionid=QPF0SG5PBTBBTKC4D3NVAFY?_dyncharset=ISO-8859-1&id=pcat17071&type=page&st=turok&sc=Global&cp=1&nrp=15&sp=&qp=&list=n&iht=y&usc=All+Categories&ks=960');
			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;
	}
}