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 popRegister()
{
    var cookie = GetCookie('notoldenough');
    if (cookie == null)
    {
        popScrollingWindow("register.html",361,450,"register");
    }
    else
    {
        popsignuptooyoung();
    }
}
function popTerms()
{
    popScrollingWindow('terms.html',385,450,'terms');
}
function popPrivacy()
{
    popScrollingWindow('privacy.html',385,450,'privacy');
}

function popTrailer()
{
    openWindow("http://www.apple.com/trailers/paramount/school_of_rock");
}

function popMainSite()
{
    popWindow("main_detect.html",700,465,"main_site");
}
function popMainSiteDeepLink()
{
    popWindow("main_detect.html"+window.location.search,700,465,"main_site");
}
function deepLinkInterviews()
{
    popWindow("main_detect.html?deepLink=true&section=bts",700,465,"main_site");
}
function deepLinkMovieClips()
{
    popWindow("main_detect.html?deepLink=true&section=movieClips",700,465,"main_site");
}
function deepLinkSoundtrack()
{
    popWindow("main_detect.html?deepLink=true&section=soundTrack",700,465,"main_site");
}

function popStageDiveGame()
{
    popWindow("stagedive.html",750,500,"stagedive");
}

function popAIM()
{
    popWindow("aim/menu.html",630,335,"aim_icons");
}

function popWallpaper(number, size)
{
    openWindow("epk/downloads/instructions.html?wallpaper="+number+"_"+size+".jpg");
}

function popSneakPreview()
{
    popWindow("sneakpreview.html",450,266,"sneak_preview");
}

function popMovieTickets()
{
    openWindow("http://www.movietickets.com/movie_detail.asp?movie_id=41237");
}

function popMovieFone()
{
    openWindow("http://www.moviefone.com/showtimes/movie.adp?movieid=14899&date=20030923");
}

function popFandango()
{
    openWindow("http://www.fandango.com/movie_page.asp?mv=76881");
}

function popTriviaGame()
{
    popWindow("trivia.html",500,460,"trivia");
}
function popRatGame()
{
    popTriviaGame();
}

function popBandNameGenerator()
{
    popWindow("bandnamegenerator.html",650,500,"band_name");
}

function popWinamp()
{
    window.location.href = "winamp/School_of_Rock.wal";
}

function popReviews()
{
    popScrollingWindow("reviews.html",480,480,"reviews");
}

function popEcard(targetName, sourceName, message)
{
    var ecardLink = "ecard_pickup.html?targetName=" + targetName + "&sourceName=" + sourceName + "&message=" + message;
    popWindow(ecardLink,550,400,"ecard");
}

/*function popInterviewClip(clip, player, size)
{
    popWindow("clips/interviews.html?clip="+clip+"&player="+player+"&size="+size, 630, 420, "interview_clip");
}

function popVideoClip(clip, player, size)
{
    popWindow("clips/clips.html?clip="+clip+"&player="+player+"&size="+size, 630, 420, "video_clip");
}*/

//backwards in flash
function popInterviewClip(clip, size, player)
{
    popWindow("clips/interviews.html?clip="+clip+"&player="+player+"&size="+size, 630, 420, "interview_clip");
}

function popVideoClip(clip, size, player)
{
    popWindow("clips/clips.html?clip="+clip+"&player="+player+"&size="+size, 630, 420, "video_clip");
}


