function popWindow( url, width, height, windowName )
{
    //get center coords
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    
    return 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 popWindowRating( url, width, height, windowName )
{
    //get center coords
    //var left = 0;
    //var top = 0;
    var left = (screen.width - width) ;
    var top = 0;

    
    return 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;
    
    return 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";
    return window.open(url,rand,"directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
}

function downloadFile(theFile)
{
    popWindow("download.html?theFile="+theFile, 300, 100, "downloadWindow");
}

var debugFlag = false;
function debug(string)
{
	if (debugFlag == true)
	{
		alert(string);
	}
}

function track(trackString)
{
    switch (trackString)
    {
    case "XXXXX":
        debug(trackString);
        break;
    default:
        debug(trackString);
        _hbPageView(trackString, "/chicken+little");
        break;
    }
}

function loadMain()
{
	location.replace("main.html");
}

function popTrailer()
{
	track("trailer");
	popWindow("clips/trailer_menu.html",640,360,"trailer");
}

function popClip(clip, player, size)
{
    player = player.toUpperCase();
    size = size.toLowerCase();

    track("watch+video+" + clip + "+" + player + "_" + size);

    popWindow('clips/clips.html?movie='+clip+'&size='+player+size, 648, 488, clip+"_win");
}
function popAIM()
{
    track("aim+icons");
    popWindow("aim/aim.html", 500, 416, "aim_icons");
}
function popWallpaper(number, size)
{
	track("wallpaper+"+number+"+"+size);
	openWindow("wallpaper/wallpaper.html?wallpaper=wallpaper_"+number+"_"+size+".jpg");
}

function popSignup()
{
	openWindow("http://signup.universalstudios.com/form/296");
}

function popTerms()
{
	openWindow("http://www.universalpictures.com/legal/index.html");
}

function popFeedback()
{
	openWindow("http://www.universalpictures.com/globaldb/feedback_step1.html");
}

function popPrivacy()
{
	openWindow("http://www.universalpictures.com/legal/privacy.html");
}

function popParental()
{
	openWindow("http://www.parentalguide.org");
}

function popFilmRatings()
{
	openWindow("http://www.filmratings.com");
}

function popFlash()
{
	openWindow("http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash");
}

function popQuicktime()
{
	openWindow("http://www.apple.com/quicktime/download/");
}

function popWindows()
{
	openWindow("http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx?displang=en&qstechnology=");
}

function popUniversal()
{
	openWindow("http://www.universalpictures.com/");
}

function popAppleTrailer()
{
	openWindow("http://www.apple.com/trailers/universal/munich/");
}

function popAppleTrailerHD()
{
	openWindow("http://www.apple.com/trailers/universal/munich/hd/");
}


function popRegister()
{
	openWindow("http://signup.universalstudios.com/form/296");
}

function popBuyTickets()
{
	openWindow("http://movies.aol.com/movie/main.adp?_pgtyp=pdct&mid=23217");
}

function popPreOrder()
{
	openWindow("http://homevideo.universalstudios.com/title_old.php?titleId=2878");
}

function popBonusFeatures()
{
	popWindowRating("dvd_bonus_features.html",500,500,"DVDBonusFeatures");
}

function popSoundtrack()
{
	openWindow("http://www.iclassics.com/productDetail?contentId=64422");
}

function popCC()
{
	openWindow("http://www.firstusa.com/cgi-bin/webcgi/webserve.cgi?partner_dir_name=universal_kong&page=cont&mkid=60MN&msc=Z0029990");
}

function popLink1()
{
	openWindow("http://www.time.com/time/europe/magazine/2002/0902/munich/");
}

function popLink2()
{
	openWindow("http://www.infoplease.com/spot/mm-munich.html");
}

function popLink3()
{
	openWindow("http://www.specialoperations.com/Counterterrorism/munich_ct.htm");
}

function popLink4()
{
	openWindow("http://www.sptimes.com/News/122999/Sports/Terrorists_turn__72_M.shtml");
}

function popLink5()
{
	openWindow("http://en.wikipedia.org/wiki/Munich_Massacre");
}

function popLink6()
{
	openWindow("http://www.filmeducation.org/secondary/OneDay.html");
}


function popRating()
{
    popWindowRating("rating.html", 500, 400, "rating");
}

function popTime()
{

	popWindow("time.html", 600, 500,"timeMag");
}



















