var lastPopUpWindow = null;
function pop (sCase)
{
	// close the last pop-up.
	try {
		lastPopUpWindow.close ();
	} catch(e) {
	}
	switch (sCase){
			//VIDEOS
			case "teaser1":
	    	lastPopUpWindow = window.open('teaser_options.html','_blank','width=700,height=500');
	    	break;

			case "trailer1":
	  			lastPopUpWindow = window.open('trailer_options.html','_blank','width=700,height=500');
	  		break;
			case "trailer2":
	  			lastPopUpWindow = window.open('trailer2_options.html','_blank','width=700,height=500');
	  		break;
	    	
			case "animfeature1":
	    		lastPopUpWindow = window.open('animfeature1_options.html','_blank','width=700,height=500');
	    	break;
			case "animfeature2":
	    		lastPopUpWindow = window.open('animfeature2_options.html','_blank','width=700,height=500');
	    	break;
			case "animfeature3":
	    		lastPopUpWindow = window.open('animfeature3_options.html','_blank','width=700,height=500');
	    	break;
	    	case "animfeature4":
	    		lastPopUpWindow = window.open('animfeature4_options.html','_blank','width=700,height=500');
	    	break;
	    	case "animfeature5":
	    		lastPopUpWindow = window.open('animfeature5_options.html','_blank','width=700,height=500');
	    	break;
			case "featurette1":
	    		lastPopUpWindow = window.open('featurette1_options.html','_blank','width=700,height=500');
	    	break;
			case "featurette2":
	    		lastPopUpWindow = window.open('featurette2_options.html','_blank','width=700,height=500');
	    	break;
			case "featurette3":
	    		lastPopUpWindow = window.open('featurette3_options.html','_blank','width=700,height=500');
	    	break;
			case "featurette4":
	    		lastPopUpWindow = window.open('featurette4_options.html','_blank','width=700,height=500');
	    	break;
			case "clip1":
	    		lastPopUpWindow = window.open('clip1_options.html','_blank','width=700,height=500');
	    	break;
	
	
	
			//DOWNLOADS section
			case "wallpaper" : //wallpaperID number, width
				var id = pop.arguments [1];
				var width = pop.arguments [2];
				var height=0;
				switch (width){
					case '1600' : height=1200; break;
					case '1920' : height=1200; break;
					default : width=1920; height=1200; break;
				}
				window.open('wallpaper.html?id=' +id + '&width=' + width +"&height=" + height,'_BLANK');
				break;
			case "buddyicons":
			case "icons" :
				var iconURL = 'icons.html';
				window.open(iconURL,'_blank','width=360,height=500,scrollbars=0,resizable=0,toolbar=0,status=0,location=0');
			break;
			case "poster" :
				lastPopUpWindow = window.open('download.html?theFile=assets/downloads/poster/princessandthefrog_poster.zip','_blank','width=380,height=450');
			break;
			case "screensaver_mac" :
				lastPopUpWindow = window.open('download.html?theFile=assets/downloads/screensavers/ThePrincessAndTheFrogScreensaver_MAC.zip','_blank','width=380,height=450');
			break;
			case "screensaver_pc":
				lastPopUpWindow = window.open('download.html?theFile=assets/downloads/screensavers/ThePrincessAndTheFrogScreensaver_PC.zip','_blank','width=380,height=450');
			break;
	
	
		//HOME links
		case "register" :
			trackLink("exit_dpic_frog_register_now");
			setTimeout("window.open('https://register.go.com/wdpictures/princessandthefrog/chooseAge?appRedirect=http://disney.go.com/disneypictures/princessandthefrog')", 50);
		break;
		
		//GAME popups
		case "game1" :
			lastPopUpWindow = window.open('http://disney.go.com/disneypictures/princessandthefrog/games/bayou','_blank','width=800,height=550');
			break;
		case "game2" :
			lastPopUpWindow = window.open('http://disney.go.com/disneypictures/princessandthefrog/games/tianatiara/frog_spl_adv_tianaandthetiara.html','_blank','width=800,height=550');
			break;
		case "game3" :
			lastPopUpWindow = window.open('http://disney.go.com/disneypictures/princessandthefrog/games/louisband/frog_spl_act_louisbandonthebayou.html','_blank','width=800,height=650');
			break;
		case "game4" :
			lastPopUpWindow = window.open('http://disney.go.com/disneypictures/princessandthefrog/games/magicgumbomix/','_blank','width=770,height=680');
			break;
		case "game5" :
			lastPopUpWindow = window.open('http://disney.go.com/disneypictures/princessandthefrog/games/games/frog_spl_puz_loveatfirstbright','_blank','width=790,height=650');
			break;
		case "game6" :
			lastPopUpWindow = window.open('http://a.media.global.go.com/wdpictures/patf/coloringbook.pdf','_blank');
			break;	
		default:
			alert("troubleshooting a failed popup -- case: " + sCase);
		break;
	
	}
}