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 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+page");
		break;
	
	case "Non flash page": //getURL("javascript:track('Non flash page');");
		hitbox.Set_hbPageView("no+flash","/meet+the+robinsons/information/no+flash");
		break;
	
	case "TRAILER": //getURL("javascript:track('TRAILER');");
		hitbox.Set_hbPageView("trailer","/meet+the+robinsons/multimedia/trailers");
		break;
		
	case "POLICY": //getURL("javascript:track('POLICY');");
		hitbox.Set_hbPageView("policy","/meet+the+robinsons/multimedia/trailers");
		break;	
		
	case "SPOT1": //getURL("javascript:track('SPOT1');");
		hitbox.Set_hbPageView("spot1","/meet+the+robinsons/multimedia/tv+spots");
		break;		
	
	case "CLIP1": //getURL("javascript:track('CLIP1');");
		hitbox.Set_hbPageView("clip1","/meet+the+robinsons/multimedia/clips");
		break;	
		
	case "CLIP2": //getURL("javascript:track('CLIP2');");
		hitbox.Set_hbPageView("clip2","/meet+the+robinsons/multimedia/clips");
		break;
			
	case "FUTURETTE1": //getURL("javascript:track('FUTURETTE1');");
		hitbox.Set_hbPageView("futurette1","/meet+the+robinsons/multimedia/futurettes");
		break;	
		
	case "FUTURETTE2": //getURL("javascript:track('FUTURETTE2');");
		hitbox.Set_hbPageView("futurette2","/meet+the+robinsons/multimedia/futurettes");
		break;			
		
	
	case "ABOUT": //getURL("javascript:track('ABOUT');");
		hitbox.Set_hbPageView("about+movie","/meet+the+robinsons/about");
		break;
		
	case "SYNOPSIS": //getURL("javascript:track('SYNOPSIS');");
		hitbox.Set_hbPageView("story","/meet+the+robinsons/about/story");
		break;	
		
	case "PNOTES": //getURL("javascript:track('PNOTES');");
		hitbox.Set_hbPageView("pnotes","/meet+the+robinsons/about/prod+notes");
		break;	
		
	case "CREW": //getURL("javascript:track('CREW');");
		hitbox.Set_hbPageView("crew+bios","/meet+the+robinsons/about/cast+crew");
		break;	
		
	case "CHARACTERS": //getURL("javascript:track('CHARACTERS');");
		hitbox.Set_hbPageView("characters","/meet+the+robinsons/characters");
		break;		
		
	case "PHOTOS": //getURL("javascript:track('PHOTOS');");
		hitbox.Set_hbPageView("photos+main","/meet+the+robinsons/multimedia/photo+galleries");
		break;	
		
	case "DOWNLOADS": //getURL("javascript:track('DOWNLOADS');");
		hitbox.Set_hbPageView("downloads+main","/meet+the+robinsons/interactive+content/downloads");
		break;	
		
	case "WALLPAPERS": //getURL("javascript:track('WALLPAPERS');");
		hitbox.Set_hbPageView("wallpapers","/meet+the+robinsons/downloads/wallpapers");
		break;	
		
	case "WALLPAPERS2": //getURL("javascript:track('WALLPAPERS2');");
		hitbox.Set_hbPageView("wp2","/meet+the+robinsons/downloads/wallpapers");
		break;		
		
	case "WALLPAPERS3": //getURL("javascript:track('WALLPAPERS3');");
		hitbox.Set_hbPageView("wp3","/meet+the+robinsons/downloads/wallpapers");
		break;
		
	case "WALLPAPERS4": //getURL("javascript:track('WALLPAPERS4');");
		hitbox.Set_hbPageView("wp4","/meet+the+robinsons/downloads/wallpapers");
		break;
		
	case "WALLPAPERS5": //getURL("javascript:track('WALLPAPERS5');");
		hitbox.Set_hbPageView("wp5","/meet+the+robinsons/downloads/wallpapers");
		break;
		
	case "WALLPAPERS1": //getURL("javascript:track('WALLPAPERS1');");
		hitbox.Set_hbPageView("wp1","/meet+the+robinsons/downloads/wallpapers");
		break;
		
	case "WALLPAPERS6": //getURL("javascript:track('WALLPAPERS6');");
		hitbox.Set_hbPageView("wp6","/meet+the+robinsons/downloads/wallpapers");
		break;
		
	case "WALLPAPERS7": //getURL("javascript:track('WALLPAPERS7');");
		hitbox.Set_hbPageView("wp7","/meet+the+robinsons/downloads/wallpapers");
		break;
		
	case "WALLPAPERS8": //getURL("javascript:track('WALLPAPERS8');");
		hitbox.Set_hbPageView("wp8","/meet+the+robinsons/downloads/wallpapers");
		break;							
		
	case "BUDDYICONS": //getURL("javascript:track('BUDDYICONS');");
		hitbox.Set_hbPageView("icons","/meet+the+robinsons/downloads/icons");
		break;	
	
	case "AIM2": //getURL("javascript:track('AIM2');");
		hitbox.Set_hbPageView("icons+download","/meet+the+robinsons/downloads/icons");
		break;
		
	case "SCREENSAVER": //getURL("javascript:track('SCREENSAVER');");
		hitbox.Set_hbPageView("screensavers","/meet+the+robinsons/downloads/screensavers");
		break;	
		
	case "SCREENSAVER1": //getURL("javascript:track('SCREENSAVER1');");
		hitbox.Set_hbPageView("ss+pc","/meet+the+robinsons/downloads/screensavers");
		break;
		
	case "SCREENSAVER2": //getURL("javascript:track('SCREENSAVER2');");
		hitbox.Set_hbPageView("ss+mac","/meet+the+robinsons/downloads/screensavers");
		break;		
		
	case "POSTER": //getURL("javascript:track('POSTER');");
		hitbox.Set_hbPageView("onesheet","/meet+the+robinsons/downloads/posters");
		break;	
		
	case "POSTER2": //getURL("javascript:track('POSTER2');");
		hitbox.Set_hbPageView("onesheet+download","/meet+the+robinsons/downloads/posters");
		break;	
		
	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");
		break;		
			
	case "PARTNERS3": //getURL("javascript:track('PARTNERS3');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_AD+COUNCIL","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS4": //getURL("javascript:track('PARTNERS4');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_VALPAK","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS5": //getURL("javascript:track('PARTNERS5');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_STREET+SURFING","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS6": //getURL("javascript:track('PARTNERS6');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_CARVEL","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS7": //getURL("javascript:track('PARTNERS7');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_FIZZY+FRUIT","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS8": //getURL("javascript:track('PARTNERS8');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_HINT","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS9": //getURL("javascript:track('PARTNERS9');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_LANGERS","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS10": //getURL("javascript:track('PARTNERS10');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_NWA+VACATIONS","/meet+the+robinsons/synergy");
		break;
		
	case "PARTNERS11": //getURL("javascript:track('PARTNERS11');");
		hitbox.Set_hbPageView("Exit_Meet+The+Robinsons_SYLVANIA","/meet+the+robinsons/synergy");
		break;										
			
			
		
	case "GAMES": //getURL("javascript:track('GAMES');");
		hitbox.Set_hbPageView("games+main","/meet+the+robinsons/interactive+content/games");
		break;			
		
	case "ECARD": //getURL("javascript:track('ECARD');");
		hitbox.Set_hbPageView("send+main","/meet+the+robinsons/send+friend");
		break;	
		
	case "VDAY": //getURL("javascript:track('ECARD');");
		hitbox.Set_hbPageView("send+main","/meet+the+robinsons/send+friend+vday");
		break;	
		
	case "ECARDSEND": //getURL("javascript:track('ECARDSEND');");
		hitbox.Set_hbPageView("send+button","/meet+the+robinsons/send+friend");
		break;	
		
	case "SUPERBOWL": //getURL("javascript:track('HOMEVIDEO');");
		hitbox.Set_hbPageView("superbowl+trailer","/meet+the+robinsons/multimedia/trailers");
		break;	
		
	case "VIDEOS": //getURL("javascript:track('VIDEOPAGE');");
		hitbox.Set_hbPageView("video+main","/meet+the+robinsons/multimedia");
		break;		
		
	case "Trailer5": //getURL("javascript:track('Trailer5');");
		hitbox.Set_hbPageView("Trailer5","/meet+the+robinsons/multimedia/trailers");
		break;	
		
		
	case "GenericPolicy": //getURL("javascript:track('GenericPolicy');");
		hitbox.Set_hbPageView("GenericPolicy","/meet+the+robinsons/multimedia/trailers");
		break;	
		
		case "MURALMANIA": //getURL("javascript:track('MURALMANIA');");
		hitbox.Set_hbPageView("mural+mania","/meet+the+robinsons/interactive+content/games");
		break;	
		
		
	case "TIMETRAVELER": //getURL("javascript:track('TIMETRAVELER');");
		hitbox.Set_hbPageView("time+traveler","/meet+the+robinsons/interactive+content/games");
		break;	
		
	case "SUDOKU": //getURL("javascript:track('SUDOKU');");
		hitbox.Set_hbPageView("sudoku","/meet+the+robinsons/interactive+content/games");
		break;	
			
	case "QUIZ": //getURL("javascript:track('PERSONALITYQUIZ');");
		hitbox.Set_hbPageView("personality+quiz","/meet+the+robinsons/interactive+content/games");
		break;				

	case "TALLULAHDRESSUP": //getURL("javascript:track('TALLULAHDRESSUP');");
		hitbox.Set_hbPageView("fashion","/meet+the+robinsons/interactive+content/games");
		break;	

	case "DASHFORDORIS": //getURL("javascript:track('DASHFORDORIS');");
		hitbox.Set_hbPageView("dash+doris","/meet+the+robinsons/interactive+content/games");
		break;	

	default:
		hbDebug('not tracking properly: [' + key + ']');
		break;
	}
}

