function popWindow( url, width, height, windowName ){
    //get center coords
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	
	if (screen.height <= 600) {
		paramStr = 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=520,left=' + left + ',top=' + top;
	 } else {
		paramStr = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;
	 }
	 
	 window.open(url, windowName, paramStr);
}

function popScrollableWindow( url, width, height, windowName ){
    //get center coords
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	
	paramStr = 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top;
	 
	 window.open(url, windowName, paramStr);
}

function loadImg(imgName, imgSrc) {
    if (!loadFlag) {
        eval(imgName + ' = new Image()');
        eval(imgName + '.src = "' + imgSrc + '"');
        return imgName;
    }
}

function swapImg(imgName, imgObject) {
    if (loadFlag) {
        document.getElementById(imgName).src = eval(imgObject + '.src');
    }
}

///////////////////////////////////////////
// hitbox stuff
///////////////////////////////////////////

// how to turn on debug messages:
// run the site in a browser and paste this into the location bar:
// javascript:alert(debugFlag=true);
// you should see a popup that says "true"
var debugFlag = false;
function hbDebug(message)
{
	if (debugFlag == true)
	{
		alert(message);
	}
}

// this function gets called from flash to do hitbox and any other tracking.
// basically if you want to track any of these sections from flash you can just
// copy paste the getURL() call from any of these right into the on(release) of 
// the flash button that's linking to that section.
// the strings were all taken directly from Meet the Robinsons HBX strings v1(teaser).xls
function track(key)
{
	// alert(key);
	
	hbDebug(key);

	switch(key)
	{
	case "HOME": //getURL("javascript:track('HOME');");
		hitbox.Set_hbPageView("main+home+page","/meet+the+robinsons/information/home;information/animation/meet+the+robinsons/home");
		break;
	
	case "REUNION": //getURL("javascript:track('HOME');");
		hitbox.Set_hbPageView("reunion+splash","/meet+the+robinsons/information/splash;information/pixar+animation/meet+the+robinsons/splash");
		break;
	
	case "WP_REUNION": //getURL("javascript:track('HOME');");
		hitbox.Set_hbPageView("wp+reunion","/meet+the+robinsons/multimedia/wallpapers;multimedia/pixar+animation/meet+the+robinsons/wallpapers");
		break;
	
	case "Non flash page": //getURL("javascript:track('Non flash page');");
		hitbox.Set_hbPageView("no+flash","/meet+the+robinsons/information/home;information/animation/meet+the+robinsons/home");
		break;
	
	
	// DISNEY MOVIE REWARDS
	case "DMR": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbLink("exit_meet+the+robinsons_disney+movie+rewards");
		break;
		
		
	// BUY NOW
	case "BLURAY": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbLink("exit_meet+the+robinsons_order+bluray");
		break;
		
	case "DVD": //getURL("javascript:track('POLICY');");
		hitbox.Set_hbLink("exit_meet+the+robinsons_order+dvd");
		break;	
		

	// ABOUT
	case "ABOUT": //getURL("javascript:track('ABOUT');");
		hitbox.Set_hbPageView("about+main","/meet+the+robinsons/about;about/animation/meet+the+robinsons");
		break;
		
	case "SYNOPSIS": //getURL("javascript:track('SYNOPSIS');");
		hitbox.Set_hbPageView("synopsis","/meet+the+robinsons/about/story;about/animation/meet+the+robinsons/story");
		break;	
		
	case "ABOUT-DVD": //getURL("javascript:track('PNOTES');");
		hitbox.Set_hbPageView("dvd+bonus+features","/meet+the+robinsons/about/dvd+features;about/animation/meet+the+robinsons/dvd+features");
		break;	
		
	case "ABOUT-BLURAY": //getURL("javascript:track('CREW');");
		hitbox.Set_hbPageView("bluray+bonus+features","/meet+the+robinsons/about/bluray+features;about/animation/meet+the+robinsons/bluray+features");
		break;	
				
	
	// CHARACTERS
	case "CHARACTERS": //getURL("javascript:track('ABOUT');");
		hitbox.Set_hbPageView("characters+main","/meet+the+robinsons/about/char;char/animation/meet+the+robinsons");
		break;
		

	// VIDEO
	case "VIDEO": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("videos+main","/meet+the+robinsons/multimedia;multimedia/animation/meet+the+robinsons");
		break;
		
	case "TRAILER": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("trailer","/meet+the+robinsons/multimedia/trailer;multimedia/animation/meet+the+robinsons/trailer");
		break;
		
	case "SNEAKPEEK": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("sneak+peek","/meet+the+robinsons/multimedia/sneak+peek;multimedia/animation/meet+the+robinsons/sneak+peek");
		break;
		
	case "CLIP1": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("clip1","/meet+the+robinsons/multimedia/clips;multimedia/animation/meet+the+robinsons/clips");
		break;
		
	case "CLIP2": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("clip2","/meet+the+robinsons/multimedia/clips;multimedia/animation/meet+the+robinsons/clips");
		break;
		
	case "CLIP3": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("clip3","/meet+the+robinsons/multimedia/clips;multimedia/animation/meet+the+robinsons/clips");
		break;
		
	case "CLIP4": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("clip4","/meet+the+robinsons/multimedia/clips;multimedia/animation/meet+the+robinsons/clips");
		break;
		
	case "DVD1": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("dvd+bonus+clip1","/meet+the+robinsons/multimedia/bonus+clips;multimedia/animation/meet+the+robinsons/bonus+clips");
		break;
		
	case "DVD2": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("dvd+bonus+clip2","/meet+the+robinsons/multimedia/bonus+clips;multimedia/animation/meet+the+robinsons/bonus+clips");
		break;
		
	
	
	//PHOTOS
	case "PHOTOS": //getURL("javascript:track('PHOTOS');");
		hitbox.Set_hbPageView("photos+main","/meet+the+robinsons/multimedia/photo+galleries;multimedia/animation/meet+the+robinsons/photo+galleries");
		break;	
		
	
	// DOWNLOADS
	case "DOWNLOADS": //getURL("javascript:track('DOWNLOADS');");
		hitbox.Set_hbPageView("downloads+main","/meet+the+robinsons/downloads;downloads/animation/meet+the+robinsons");
		break;	
		
	case "WALLPAPERS": //getURL("javascript:track('WALLPAPERS');");
		hitbox.Set_hbPageView("wallpapers","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;	
		
	case "WALLPAPERS1": //getURL("javascript:track('WALLPAPERS');");
		hitbox.Set_hbPageView("wp1","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;	
		
	case "WALLPAPERS2": //getURL("javascript:track('WALLPAPERS2');");
		hitbox.Set_hbPageView("wp2","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;		
		
	case "WALLPAPERS3": //getURL("javascript:track('WALLPAPERS3');");
		hitbox.Set_hbPageView("wp3","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;
		
	case "WALLPAPERS4": //getURL("javascript:track('WALLPAPERS4');");
		hitbox.Set_hbPageView("wp4","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;
		
	case "WALLPAPERS5": //getURL("javascript:track('WALLPAPERS5');");
		hitbox.Set_hbPageView("wp5","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;
		
	case "WALLPAPERS1": //getURL("javascript:track('WALLPAPERS1');");
		hitbox.Set_hbPageView("wp1","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;
		
	case "WALLPAPERS6": //getURL("javascript:track('WALLPAPERS6');");
		hitbox.Set_hbPageView("wp6","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;
		
	case "WALLPAPERS7": //getURL("javascript:track('WALLPAPERS7');");
		hitbox.Set_hbPageView("wp7","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;
		
	case "WALLPAPERS8": //getURL("javascript:track('WALLPAPERS8');");
		hitbox.Set_hbPageView("wp8","/meet+the+robinsons/downloads/wallpapers;downloads/animation/meet+the+robinsons/wallpapers");
		break;							
		
	case "BUDDYICONS": //getURL("javascript:track('BUDDYICONS');");
		hitbox.Set_hbPageView("icons","/meet+the+robinsons/downloads/icons;downloads/animation/meet+the+robinsons/icons");
		break;	
	
	case "AIM2": //getURL("javascript:track('AIM2');");
		hitbox.Set_hbPageView("icons+download","/meet+the+robinsons/downloads/icons;downloads/animation/meet+the+robinsons/icons");
		break;
		
	case "SCREENSAVER": //getURL("javascript:track('SCREENSAVER');");
		hitbox.Set_hbPageView("screensavers","/meet+the+robinsons/downloads/screensavers;downloads/animation/meet+the+robinsons/screensavers");
		break;	
		
	case "SCREENSAVER1": //getURL("javascript:track('SCREENSAVER1');");
		hitbox.Set_hbPageView("ss+pc","/meet+the+robinsons/downloads/screensavers;downloads/animation/meet+the+robinsons/screensavers");
		break;
		
	case "SCREENSAVER2": //getURL("javascript:track('SCREENSAVER2');");
		hitbox.Set_hbPageView("ss+mac","/meet+the+robinsons/downloads/screensavers;downloads/animation/meet+the+robinsons/screensavers");
		break;		
		
	case "POSTER": //getURL("javascript:track('POSTER');");
		hitbox.Set_hbPageView("poster","/meet+the+robinsons/downloads/posters;downloads/animation/meet+the+robinsons/posters");
		break;	
		
	case "EMAILSIGNATURE": //getURL("javascript:track('POSTER2');");
		hitbox.Set_hbPageView("email+signature","/meet+the+robinsons/downloads/email+signatures;downloads/animation/meet+the+robinsons/email+signatures");
		break;	
		
	
	
	// PARTNERS
	case "PARTNERS": //getURL("javascript:track('PARTNERS');");
		hitbox.Set_hbPageView("partners","/meet+the+robinsons/synergy");
		break;	
			
	case "PARTNERS2": //getURL("javascript:track('PARTNERS2');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_DISNEY+STORE","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;		
			
	case "PARTNERS3": //getURL("javascript:track('PARTNERS3');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_AD+COUNCIL","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS4": //getURL("javascript:track('PARTNERS4');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_VALPAK","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS5": //getURL("javascript:track('PARTNERS5');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_STREET+SURFING","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS6": //getURL("javascript:track('PARTNERS6');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_CARVEL","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS7": //getURL("javascript:track('PARTNERS7');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_FIZZY+FRUIT","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS8": //getURL("javascript:track('PARTNERS8');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_HINT","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS9": //getURL("javascript:track('PARTNERS9');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_LANGERS","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS10": //getURL("javascript:track('PARTNERS10');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_NWA+VACATIONS","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;
		
	case "PARTNERS11": //getURL("javascript:track('PARTNERS11');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_SYLVANIA","/meet+the+robinsons/synergy;partners/synergy/meet+the+robinsons");
		break;										
			

	// GAMES
	case "GAMES": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("games+main","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;			
		
	case "TIMETRAVELER": //getURL("javascript:track('TIMETRAVELER');");
		hitbox.Set_hbPageView("time+traveler","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	
		
	case "MURALMANIA": //getURL("javascript:track('MURALMANIA');");
		hitbox.Set_hbPageView("mural+mania","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	
		
	case "UNCLEARTSPIZZADELIVERY": //getURL("javascript:track('TIMETRAVELER');");
		hitbox.Set_hbPageView("pizza+delivery","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	
		
	case "TALLULAHDRESSUP": //getURL("javascript:track('TALLULAHDRESSUP');");
		hitbox.Set_hbPageView("fashion","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	

	case "DDR": //getURL("javascript:track('TALLULAHDRESSUP');");
		hitbox.Set_hbPageView("ddr","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	

	case "PUZZLE": //getURL("javascript:track('SUDOKU');");
		hitbox.Set_hbPageView("puzzle","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	
			
	case "FRANKIESMUSICMASHUP": //getURL("javascript:track('PERSONALITYQUIZ');");
		hitbox.Set_hbPageView("music+mashup","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;				

	case "QUIZ": //getURL("javascript:track('PERSONALITYQUIZ');");
		hitbox.Set_hbPageView("personality+quiz","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;				

	case "FAMILYTREE": //getURL("javascript:track('DASHFORDORIS');");
		hitbox.Set_hbPageView("family+tree","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	

	case "DASHFROMDORIS": //getURL("javascript:track('DASHFORDORIS');");
		hitbox.Set_hbPageView("dash+doris","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;	
		
	case "BUBBLETROUBLE": //getURL("javascript:track('BUBBLETROUBLE');");
		hitbox.Set_hbPageView("bubble+trouble","/meet+the+robinsons/interactive+content/games;interactive+content/animation/meet+the+robinsons/games");
		break;


	// ACTIVITIES
	case "ACTIVITIES": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("activities","/meet+the+robinsons/activity+pages;activity+pages/animation/meet+the+robinsons");
		break;			

	case "HALLOWEENCARDS": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("halloween+cards+main","/meet+the+robinsons/activity+pages/ecards;activity+pages/animation/meet+the+robinsons/ecards");
		break;			

	case "HALLOWEENCARD": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("halloween+card","/meet+the+robinsons/activity+pages/ecards;activity+pages/animation/meet+the+robinsons/ecards");
		break;			

	case "TATTOOS": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("tattoo+main","/meet+the+robinsons/activity+pages/tattoos;activity+pages/animation/meet+the+robinsons/tattoos");
		break;			

	case "TATTOO1": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("tattoo","/meet+the+robinsons/activity+pages/tattoos;activity+pages/animation/meet+the+robinsons/tattoos");
		break;			

	case "ACTIVITYSHEETS": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("activitiy+sheets+main","/meet+the+robinsons/activity+pages/activities;activity+pages/animation/meet+the+robinsons/activity+sheets");
		break;			

	case "ACTIVITYSHEET1": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("activitiy+sheet1","/meet+the+robinsons/activity+pages/activities;activity+pages/animation/meet+the+robinsons/activity+sheets");
		break;			

	case "ACTIVITYSHEET2": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("activitiy+sheet2","/meet+the+robinsons/activity+pages/activities;activity+pages/animation/meet+the+robinsons/activity+sheets");
		break;			

	case "BOOKMARKS": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("bookmarks+main","/meet+the+robinsons/activity+pages/bookmarks;activity+pages/animation/meet+the+robinsons/bookmarks");
		break;			

	case "BOOKMARK1": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("bookmark1","/meet+the+robinsons/activity+pages/bookmarks;activity+pages/animation/meet+the+robinsons/bookmarks");
		break;			

	case "BOOKMARK2": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("bookmark2","/meet+the+robinsons/activity+pages/bookmarks;activity+pages/animation/meet+the+robinsons/bookmarks");
		break;			

	case "BOOKMARK3": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("bookmark3","/meet+the+robinsons/activity+pages/bookmarks;activity+pages/animation/meet+the+robinsons/bookmarks");
		break;			

	case "BOOKMARK4": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("bookmark4","/meet+the+robinsons/activity+pages/bookmarks;activity+pages/animation/meet+the+robinsons/bookmarks");
		break;			

	case "BOOKMARK5": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("bookmark5","/meet+the+robinsons/activity+pages/bookmarks;activity+pages/animation/meet+the+robinsons/bookmarks");
		break;			


	//MISC	
	case "MOBILE": //getURL("javascript:track('ECARD');");
		hitbox.Set_hbPageView("mobile","meet+the+robinsons_mobile");
		break;	
		
	case "ORDER": //getURL("javascript:track('ECARD');");
		hitbox.Set_hbLink("meet+the+robinsons_menu_order+now");
		break;	
		
	default:
		hbDebug('not tracking properly: [' + key + ']');
		break;
	}
}
