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 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)
{
    return window.open(url,"_blank","directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
}
function downloadFile(theFile)
{
	popWindow("download.html?theFile="+theFile, 400, 200, "download");
}

function popPoster(number)
{
    //track("poster+"+number);
    popScrollingWindow('posterconfirm.html?poster='+number,400,560,'Poster');
}

function popWallpaper(number, size)
{
    track("wp"+number+"+"+size);
    openWindow("desktops/instructions.html?wallpaper=wallpaper" + number + "_" + size + ".jpg");
}

function popExperience(queryString)
{
    track("visit+mansion");
    popWindow("experience/index.html?"+queryString, 780, 600, "mansion_experience");
}

function popHalloweenFun()
{
    popScrollingWindow("halloweenpopup/halloweenfun_noframes.html", 570, 600, "halloween_fun");
}

function pop3dTour()
{
    popWindow("3dtour/index.html", 570, 600, "3dTour");
}

function popAimIcons()
{
	track("icons+download");
    popWindow("aim/aim.html", 445, 465, "aim_icons");
}

function popFanSite()
{
    downloadFile("fansite.zip");
}

function popElCapitan()
{
    popWindow("el_capitan/home.html", 500, 600, "el_capitan");
}

function ticketsAndShowtimes(zip, city, state)
{
    openWindow("http://movietimes.disney.go.com/cgi/movielistings/request.dll?MOVIESPECIFIC&aff_code=compaq&movie_id=41030&zip_code="+zip+"&city="+city+"&state="+state);
}

function popScreensaverOS9()
{
    //window.location.href = "screensavers/haunted_screensaver_OS9.sit";
    downloadFile("screensavers/haunted_screensaver_OS9.sit");
}
function popScreensaverOSX()
{
    //window.location.href = "screensavers/haunted_screensaver_OSX.sit";
    downloadFile("screensavers/haunted_screensaver_OSX.sit");
}
function popScreensaverWindows()
{
	track("ss+pc");
    //window.location.href = "screensavers/haunted_screensaver_setup.zip";
    downloadFile("screensavers/haunted_screensaver_setup.zip");
}


function popOrder()
{
	track("order");
	openWindow("http://go-disneystore.com/hauntedmansiondvdfs");
	//popWindow("http://disneyvideos.disney.go.com/moviefinder/calltoorder.html",400,300,"order");
}

function popClip1()
{
	//track("clip1");
	popDVDClipWindow("e19353");
}
function popClip2()
{
	//track("clip2");
	popDVDClipWindow("e19352");
}
function popClip3()
{
	//track("clip3");
	popDVDClipWindow("e19354");
}
function popTrailer()
{
	//track("trailer");
	popDVDClipWindow("e19337");
}

function popDVDClipWindow(clipCode)
{
    popWindow("http://www.totaleclips.com/disney/player/splash.asp?clipid="+clipCode,340,490,+"trailer");
	//alert(clipName);
}

function popTokenZone()
{
	track("tzone+cards");
	openWindow("http://disney.tokenzone.com/dtz2/set/mansion/CaptureEvent?sc=tc1301-KHDIE-7STCC-87BJ5");
}
