var pageRoot = "";var siteIsOpen = "true";var punctilioWindow = "";var snicketReportWindow = "";var ipixWindow = "";if (window.opener && window.opener != "null"){	punctilioWindow = window.opener;	snicketReportWindow = window.opener;	ipixWindow = window.opener;}function popWindow( url, width, height, windowName ){    //get center coords    var windowLeft = (screen.width - width) / 2;    var windowTop = (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=' + windowLeft + ',top=' + windowTop);}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 openWindow2(url, width, height){    //get center coords    var left = (screen.width - width) / 2;    var top = (screen.height - height) / 2;    var rand = "_blank";    return window.open(url,rand,'directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);}function popWindowUpperLeft( url, width, height, windowName ){    return window.open(url, windowName, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=20,top=20');}function downloadFile(theFile){    popWindow(pageRoot + "download.html?theFile="+theFile, 300, 100, "downloadWindow");}var debugFlag=false;function debug(string){    if (debugFlag == true)	{		alert(string);	}}function popClip(clip, player, size){    player = player.toUpperCase();    size = size.toLowerCase();    popWindow(pageRoot + 'clips/clips.html?movie='+clip+'&size='+player+size, 648, 488, clip+"_win");}function popAIM(number){    popWindow(pageRoot + "aim/aim.html?icon="+number, 450, 450, "aim_icons");}function popWallpaper(number, size){	openWindow(pageRoot + "wallpaper/wallpaper.html?wallpaper=wallpaper_"+number+"_"+size+".jpg");}function popTerms(){	openWindow(pageRoot + "terms.html");}function popPrivacy(){	openWindow(pageRoot + "privacy.html");}function popRegister(){	snicketReportWindow = popWindowUpperLeft(pageRoot + "newsletter/register.html",420,491,"register");}function popPunctilio(eyeCount){	//alert("Terrible things are happening within this section.\nPlease come back later...");	punctilioWindow = popWindow(pageRoot + "punctilio/index.html?eyeCountParameter="+eyeCount, 662, 540, "punctilio");}function popVFDKit(){	downloadFile(pageRoot + "eye_kit.zip");}function underResolution(w,h){	return (screen.width <= w || screen.height <= h);}function homePageUrl(query){	if (query == "null" || query == "undefined" /*|| query == undefined*/)		query = "";	return pageRoot + "main_flash.html" + query;}function popSiteFullscreen(query){	if (query == "null" || query == "undefined" /*|| query == undefined*/)		query = "";	return popScrollingWindow(homePageUrl(query), screen.width, screen.height, "lemony_home");}function popSite(query){	if (query == "null" || query == "undefined" /*|| query == undefined*/)		query = "";	return openWindow(pageRoot + "main.html" + query);}function eyeClicked(eyeBannerID){	var query = "?e=" + eyeBannerID;	if (window.opener && /*window.opener != "null" &&*/ siteIsOpen)	{		window.opener.location.href = homePageUrl(query);		return;	}	popSite(query);}function notifyPopupsThatSiteWasOpened(){	if (punctilioWindow != "")	{		punctilioWindow.siteIsOpen = true;		punctilioWindow.opener = window;	}	if (snicketReportWindow != "")	{		snicketReportWindow.siteIsOpen = true;		snicketReportWindow.opener = window;	}	if (ipixWindow != "")	{		ipixWindow.siteIsOpen = true;		ipixWindow.opener = window;	}}function notifyPopupsThatSiteWasClosed(){	if (punctilioWindow != "")	{		punctilioWindow.siteIsOpen = false;	}	if (snicketReportWindow != "")	{		snicketReportWindow.siteIsOpen = false;	}	if (ipixWindow != "")	{		ipixWindow.siteIsOpen = false;	}}function popEyeBanner(banner, code){	popWindow(pageRoot + "banner_page/index.html?banner="+banner+"&code="+code, 450, 390, "banners");}function popPhotoGallery(queryString){	popWindow(pageRoot + "ls-photos.html?"+queryString, 640, 390, "photoGallery");}function popPhotoDownload(image){	openWindow2(pageRoot + "photos/photos.html?wallpaper="+image, 800, 700);}function popTradingCardGame(){	popScrollingWindow(pageRoot + "cardcollect/tradingcardgame.html",755,550,"trading");}function popFullAppleTrailer(){	openWindow("http://trailer.uip.de/lemonysnicket/trailer.html");}function popIpixWindow(ipx,w,h){	if (w==null) w=640;	if (h==null) h=480;	ipixWindow = popWindow("ipix/ipix.html?movie="+ipx+"&w="+w+"&h="+h, w, h, "lemony_ipix");}function popIpix(movie){	switch(movie)	{	case "cage":		popIpixWindow('cage:cage_final.ipx',500,400);		break;	case "centerroom":		popIpixWindow('centerroom:centerroom_final.ipx',500,400);		break;	case "frontdoor":		popIpixWindow('frontdoor:frontdoor_final.ipx',500,400);		break;	case "kitchen":		popIpixWindow('kitchen:kitchen_final.ipx',500,400);		break;	case "launch":		popIpixWindow('launch:launch_final.ipx',500,400);		break;	case "lobby":		popIpixWindow('lobby:lobby_final.ipx',500,400);		break;	case "olafroom":		popIpixWindow('olafroom:olafroom_final.ipx',500,400);		break;	case "ontrack":		popIpixWindow('ontrack:ontrack_final.ipx',500,400);		break;	case "rear":		popIpixWindow('rear:rear_final.ipx',500,400);		break;	case "store":		popIpixWindow('store:store_final.ipx',500,400);		break;	case "tablejar":		popIpixWindow('tablejar:tablejar_final.ipx',500,400);		break;	case "tower":		popIpixWindow('tower:tower_final.ipx',500,400);		break;	default:		break;	}}function popBoatGame(){	popWindow("boatgame.html",640,480,"boatgame");}function alreadyOpenWarning(){	//alert("warning!  you already have the site open!");	window.location.href = "site_already_open.html";}function focusWindow(){	window.focus();}