var lastPopUpWindow = null;

function pop(sCase) {
// close the last pop-up.
	try {
		lastPopUpWindow.close();
	}catch(e){
	}
	
	switch(sCase) {
// PETS
	case "desktopPet":
		var selectedPet = "desktoppet_" + pop.arguments[1];
		var fileArg = "pets.html?theFile=" + selectedPet + ".zip";
		doTracking(selectedPet);
		void(lastPopUpWindow = window.open(fileArg,'desktopPets','width=500,height=350,toolbar=no,scrollbars=no,resizable=no'));
		lastPopUpWindow.focus();
	break;
// MAIN NAV
	case "disneyshopping":
		lastPopUpWindow = window.open('http://disneyshopping.go.com/webapp/wcs/stores/servlet/CategoryDisplay?catalogId=10002&storeId=10051&categoryId=13925&langId=-1&N=0&Ntk=p_categoryID&Ntt=13925&Nu=p_productID', 'disneyshopping');
		doTracking ("DISNEY_SHOPPING");
	break;
	case "enchantedcall":
		lastPopUpWindow = window.open('http://disney.go.com/princess/calls/index.html', 'ec');
		doTracking ("ENCHANTED_CALL");
	break;
	case "disneyprincess":
		self.location = "http://www.disneyprincess.com";
		doTracking ("DISNEY_PRINCESS");
	break;
	
// GREETING CARD
	case "greetingCard":
		lastPopUpWindow = launchPopUpWindow('greeting_card.html','greeting_card', 700, 590);
	break;

// HOME PAGE
	case "jasmineMusicVideo":
		lastPopUpWindow = launchPopUpWindow('http://www.totaleclips.com/player/splash.aspx?clipid=e31986&playerid=2&custid=3', 'clip', 340, 466);
		doTracking ("JASMINE_MUSIC_VIDEO");
	break;
	case "order":
		lastPopUpWindow = window.open('http://transfer.go.com/cgi/transfer.dll?name=23303&SOURCE=23303&srvc=store&goto=http://disneyshopping.go.com/webapp/wcs/stores/servlet/DSIProductDisplay?catalogId=10002&storeId=10051&productId=1207309&langId=-1&categoryId=13691&CMP=OTL-TWDC_BVHE&att=BVHE');
		doTracking ("ORDER_NOW");
	break;
	
// DESTINATIONS
	case "wallpaper":
		void(lastPopUpWindow = window.open('wallpaper.html?id=' + pop.arguments[1] + '&width=' + pop.arguments[2], 'wallpaper_poster','width=850,height=650,top=40,left=40,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no'));
		lastPopUpWindow.focus();
	break;
	case "stationery":
		lastPopUpWindow = window.open('assets/downloads/stationery/' + pop.arguments[1] + '.pdf', 'stationery');
		var tracking = "stationery_" + pop.arguments[2];
		doTracking (tracking);
	break;
	case "getAcrobat":
		lastPopUpWindow = window.open('http://www.adobe.com/products/acrobat/readstep2.html','acrobat');
	break;
	
// WISHLIST
	case "printWishList":
		void(lastPopUpWindow = window.open('wishlist.html', 'wishlist','width=620,height=800,top=40,left=40,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,directories=yes,location=yes'));
		lastPopUpWindow.focus();
		doTracking ("wishlist_print");
		//launchPopUpWindow('wishlist.html', 'wishlist', 620, 800,5, true);
	break;
// SWEEPSTAKES
	case "sweepstakesRules":
		void(lastPopUpWindow = window.open('sweepstakes_popup.html','sweepstakesRules','width=790,height=600,top=40,left=40,toolbar=no,scrollbars=yes,resizable=no'));
		doTracking('sweeps_DVD');
		lastPopUpWindow.focus();
	break;
	case "sweepstakesWinners":
		void(lastPopUpWindow = window.open('sweepstakes_winners.html','sweepstakesRules','width=790,height=600,top=40,left=40,toolbar=no,scrollbars=yes,resizable=no'));
		doTracking('sweeps_DVD');
		lastPopUpWindow.focus();
	break;
	case "virtualTour":
		void(lastPopUpWindow = window.open('virtualtour.html','virtualTour','width=700,height=560,toolbar=no,scrollbars=no,resizable=no'));
		lastPopUpWindow.focus();
	break;
	case "contests":
		location.href='sweepstakes.html';
		break;
// PRINTABLES
	case "printStickers":
		void(lastPopUpWindow = window.open('assets/downloads/printables/tattoos_printout.pdf','stickers','width=815,height=600,top=40,left=40'));
		lastPopUpWindow.focus();
		break;
	case "printBookmarks":
		void(lastPopUpWindow = window.open('assets/downloads/printables/bkmrks_printout.pdf','bookmarks','width=815,height=600,top=40,left=40'));
		lastPopUpWindow.focus();
		break;
	}
}
