var lastPopUpWindow = null;

function pop(sCase) {
// close the last pop-up.
	try {
		lastPopUpWindow.close();
	}catch(e){
	}

	switch(sCase) {

// SCREENINGS POP-UP
		case "screenings":
			lastPopUpWindow = launchPopUpWindow('http://becomingjane-themovie.com/screenings', 'screenings', 750, 550);
			break;

// SOUNDTRACK
		case "soundtrack":
			window.open('http://www.amazon.com/gp/product/B000RIWAXU?ie=UTF8&tag=masterworks-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=B000RIWAXU');
			break;
	
// BOOK
		case "book":
			window.open('http://www.hyperionbooks.com/titlepage.asp?ISBN=1401309046&amp;SUBJECT=Entertainment');
			break;
		
// TMP AWARD
		case "tmp":
			window.open('http://www.trulymovingpictures.org/');
			break;
			
// READING KIT
		case "readingkit":
			lastPopUpWindow = launchPopUpWindow('assets/downloads/YMI_BecomingJane.pdf', 'readingkit', 700, 600);
			break;
			
// BOOK CLUB GUIDE
		case "bookclubguide":
			lastPopUpWindow = launchPopUpWindow('assets/downloads/BJ_Reading_Group_Guide.pdf', 'readingkit', 700, 600);
			break;

// BOOK CLUB
		case "bookclub":
			window.open('http://www.bookclubinabox.com');
			break;
			
// WHITE HOUSE
		case "whitehouse":
			window.open('http://www.thewhitehouseproject.org');
			break;
			
// READING GROUP
		case "readinggroup":
			window.open('http://www.readinggroupchoices.com');
			break;
			
// JUNIOR LEAGUE
		case "juniorleague":
			window.open('http://www.ajli.org/');
			break;
			
// MS. FOUNDATION
		case "mfw":
			window.open('http://ms.foundation.org/');
			break;
			
// GET TICKETS POP-UP
		case "gettickets":
			lastPopUpWindow = launchPopUpWindow('gettickets.html', 'gettickets', 546, 266);
			break;
		
// FANDANGO
		case "fandango":
//			lastPopUpWindow = launchPopUpWindow('http://www.fandango.com/becomingjane_102893/movietimes', '_blank');
			void(mywin=window.open('http://www.fandango.com/becomingjane_102893/movietimes', '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,directories=yes,location=yes'));
			mywin.focus();
			break;
		
// MOVIEFONE
		case "moviefone":
//			lastPopUpWindow = launchPopUpWindow('http://movies.aol.com/movie/becoming-jane/25429/main', '_blank');
			void(mywin=window.open('http://movies.aol.com/movie/becoming-jane/25429/main', '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,directories=yes,location=yes'));
			mywin.focus();
			break;
		
// MOVIE TICKETS
		case "movietickets":
			void(mywin=window.open('http://www.movietickets.com/movie_detail.asp?movie_id=53486', '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,directories=yes,location=yes'));
			mywin.focus();
		//	lastPopUpWindow = launchPopUpWindow('http://www.movietickets.com/movie_detail.asp?movie_id=53486', '_blank');
			break;
			
// CLASSIC TRAVEL
		case "classictravel":
			window.open('http://www.classictravel.com/');
			break;

			
		default:
			alert('Unimplemented pop call: '+sCase);
			break;
	}
}
