function popWindow( url, width, height, windowName )
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    win=window.open(url, windowName, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}
function popScrollingWindow(url, width, height, windowName)
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    win=window.open(url, windowName, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}
function openWindow(url)
{
    var rand = "_blank";
    win=window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
}

function popTrailer()
{
    //trackTrailer();
    popWindow("trailer/trailer_qt56.html",500,400,"trailer");
}

function popClip()
{
    //trackTrailer();
    popWindow("clips/clip_select.html",500,400,"clips");
}

function popTrailera()
{
    //trackTrailer();
    popWindow("trailer/trailer_qt300.html",500,400,"trailer");
}

function popTrailerb()
{
    //trackTrailer();
    popWindow("trailer/trailer_qt1500.html",580,500,"trailer1");
}

function popTrailerb2()
{
    //trackTrailer();
    popWindow("trailer_qt1500.html",580,500,"trailer1");
}

function popTrailerc()
{
    //trackTrailer();
    popWindow("trailer/trailer_wm56.html",500,400,"trailer");
}

function popTrailerd()
{
    //trackTrailer();
    popWindow("trailer/trailer_wm100.html",500,400,"trailer");
}

function popTrailere()
{
    //trackTrailer();
    popWindow("trailer/trailer_wm300.html",500,400,"trailer");
}

function popTrailerf()
{
    //trackTrailer();
    popWindow("trailer/trailer_rm56.html",500,400,"trailer");
}

function popTrailerg()
{
    //trackTrailer();
    popWindow("trailer/trailer_rm100.html",500,400,"trailer");
}

function popTrailerh()
{
    //trackTrailer();
    popWindow("trailer/trailer_rm300.html",500,400,"trailer");
}

function popTrailer1(type, size)
{
    if (type == "QT")
    {
        if (size == "small")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/1_small.html',680,422,'qtmovie');
        else if (size == "medium")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/1_medium.html',680,422,'qtmovie');
        else if (size == "large")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/1_large.html',680,422,'qtmovie');
    }
    else
        popWindow("trailer/movies-old.html?movie="+type+size,500,500,"trailer1");
}

function popTrailer2(type, size)
{
    if (type == "QT")
    {
        if (size == "small")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/2_small.html',680,422,'qtmovie');
        else if (size == "medium")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/2_medium.html',680,422,'qtmovie');
        else if (size == "large")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/2_large.html',680,422,'qtmovie');
    }
    else
        popWindow("trailer/movies.html?movie="+type+size,500,500,"trailer2");
}

function popTrailer3(type, size)
{
    if (size == "huge")
        popWindow('trailer/big_movies3.html?movie='+type+size,646,386,'fullscreenmovie');
    else if (type == "QT")
    {
        if (size == "small")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/3_small.html',680,422,'qtmovie');
        else if (size == "medium")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/3_medium.html',680,422,'qtmovie');
        else if (size == "large")
            popWindow('http://www.apple.com/trailers/disney/finding_nemo/trailer/3_large.html',680,422,'qtmovie');
    }
    else
        popWindow('trailer/movies3.html?movie='+type+size,500,500,'trailer3');
}




function popExtraClip1()
{
    popWindow("clips/clip1_qt56.html",500,400,"popup_clip");
}

function popExtraClip2()
{
    popWindow("clips/clip1_qt300.html",500,400,"popup_clip");
}

function popExtraClip3()
{
    popWindow("clips/clip1_wm56.html",500,400,"popup_clip");
}

function popExtraClip4()
{
    popWindow("clips/clip1_wm300.html",500,400,"popup_clip");
}

function popExtraClip5()
{
    popWindow("clips/clip1_rm56.html",500,400,"popup_clip");
}

function popExtraClip6()
{
    popWindow("clips/clip1_rm300.html",500,400,"popup_clip");
}

function popExtraClip7()
{
    popWindow("clips/clip2_qt56.html",500,400,"popup_clip");
}

function popExtraClip8()
{
    popWindow("clips/clip2_qt300.html",500,400,"popup_clip");
}

function popExtraClip9()
{
    popWindow("clips/clip2_wm56.html",500,400,"popup_clip");
}

function popExtraClip10()
{
    popWindow("clips/clip1_wm300.html",500,400,"popup_clip");
}

function popExtraClip11()
{
    popWindow("clips/clip2_rm56.html",500,400,"popup_clip");
}

function popExtraClip12()
{
    popWindow("clips/clip2_rm300.html",500,400,"popup_clip");
}

function popExtraClip13()
{
    popWindow("clips/clip3_qt56.html",500,400,"popup_clip");
}

function popExtraClip14()
{
    popWindow("clips/clip3_qt300.html",500,400,"popup_clip");
}

function popExtraClip15()
{
    popWindow("clips/clip3_wm56.html",500,400,"popup_clip");
}

function popExtraClip16()
{
    popWindow("clips/clip3_wm300.html",500,400,"popup_clip");
}

function popExtraClip17()
{
    popWindow("clips/clip3_rm56.html",500,400,"popup_clip");
}

function popExtraClip18()
{
    popWindow("clips/clip3_rm300.html",500,400,"popup_clip");
}

function popFishyFacts(type, size)
{
    popWindow("trailer/fishyfactsmovies.html?movie="+type+size,500,400,"fishyfacts");
}

function homePage()
{
    window.location.replace("main.html");
}

function popTurtleGame()
{
    trackCruisinWithCrush();
    popWindow('turtlegame.html',480,270,'turtle');
}

function popOrchestra()
{
    popWindow('oceanorchestra/index.html',800,590,'orchestra');
}

function popMemoryGame()
{
    trackDoryMemoryGame();
    popWindow('memorygame.html',640,420,'memory');
}

function popSeaGallery()
{
    trackSplashSeaGallery();
    popWindow('sea_gallery/index.html',500,400,'gallery');
}

function popPoll()
{
    trackHowManyFishPoll();
	 popWindow('poll/poll.html',370,480,'poll');
}

function popPoster()
{
    trackPoster();
    popScrollingWindow('confirm.html',400,500,'confirm');
}

function popWallpapers(number, size)
{
    var zero = '';
    if (number < 10)
        zero = '0';

    openWindow('wallpapers/instructions.html?wallpaper='+zero+number+'_'+size+'.jpg');
}

function popCard()
{
    popWindow('cards/index.html'+window.location.search,600,370,'postcard');
}

function popAIM()
{
    popWindow('aim/index.html',500,420,'nemo_aim');
}

function popAskCrush()
{
    trackAskCrush();
    popWindow('http://disney.go.com/disneypictures/findingnemo/askcrush/today/index.html',500,500,'askcrushgame');
}

function popAustraliaSweeps()
{
    trackAustraliaSweeps();
    popWindow('http://disney.go.com/disneypictures/findingnemo/sweeps/index.html',631,510,'australia_sweeps');
}

function popTradingCardGame()
{
    openWindow('http://disney.tokenzone.com/dtz2/set/nemo/Home');
}

function popFishCharades()
{
    trackFishCharades();
    popWindow('fish_charades.html',530,345,'fish_charades');
}

function popRays()
{
    trackMrRaysClassroom();
    popWindow('fn-rays.html',760,400,'raysclassroom');
}

function popScreenmate()
{
    trackScreenmate();
    popWindow('screenmate.html',351,320,'screenmate');
}

function popOceanFutures()
{
    externalLink('http://www.oceanfutures.com');
}

function popOceanFutures2()
{
    externalLink('http://www.oceanfutures.org/Nemo/index2.html');
}

function externalLink(url)
{
    popWindow('disclaimer.html?'+url,370,210,'intermediate');
}

function popPearlsPuzzle()
{
    trackPearlsPuzzle();
    popWindow('puzzlegame.html',640,400,'pearls_puzzle');
}

function popCreateAScene()
{
    trackCreateAScene();
    popWindow('createascene.html',700,500,'create_a_scene');
}

function popScreensaver(platform)
{
    switch(platform)
    {
    case 'os9':
        window.location.href='screensavers/nemo_ss_os9.sit';
        break;
    case 'osx':
        window.location.href='screensavers/nemo_ss_osx.sit';
        break;
    case 'win':
        popWindow('screensavers/nemo_ss_win.zip',100,100,'ss');
        break;
    }
}

function popCameraPickup(pickupImageData)
{
	popWindow('fn-cameragame-pickup.html?imageData='+pickupImageData,590,354,'cameraPickup');
}

function popMenuWindow( url, width, height, windowName )
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    win=window.open(url, windowName, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
}

function popHiddenSecrets()
{
    popMenuWindow('hiddensecrets/hiddensecrets.html',556,460,'hiddensecrets');
}


function popTerms()
{
    popScrollingWindow('terms.html',450,450,'terms');
}

function popTickets()
{
    popMenuWindow('tickets/index.html',620,400,'tickets');
}

