var lastPopUpWindow = null;

function pop(sCase) {
// close the last pop-up.
	try {
		lastPopUpWindow.close();
	}catch(e){
	}

	switch(sCase) {

//CHARACTER pages
		case "charactericons":
			lastPopUpWindow = launchPopUpWindow('charactericons.html', 'charactericons', 340, 520);
			break;

//ABOUT THE FILM section

//VIDEO section
		case "trailer":
			window.location="more_options.html";
			break;

//GALLERY section

//DOWNLOADS section
		case "wallpapers":
			var width = Number(pop.arguments[2]);
			var height = (width==1280 ? 1024 : width/4*3)+140;
			lastPopUpWindow = launchPopUpWindow('wallpaper.html?id='+pop.arguments[1]+'&width='+width, 'wallpaper_'+width, width+20, height, 1, true);
			break;
		case "buddyicons":
			lastPopUpWindow = launchPopUpWindow('buddyicons.html', 'buddyicons', 340, 520);
			break;

//GAMES & ACTIVITIES section
		case "burnrubber":
			lastPopUpWindow = launchPopUpWindow('burnrubber.html', 'burnrubber', 700, 533);
			break;

		default:
			alert('Unimplemented pop call: '+sCase);
		break;
	}
}