function checkSize()
{

   myHeight = 5;
   minHeight = 940;

   if( typeof( window.innerWidth ) == 'number' )
   {
      //Non-IE
      myHeight = window.innerHeight;
   } 
   else if( document.documentElement && ( document.documentElement.clientHeight ) ) 
   {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight;
   } 
   else if( document.body && ( document.body.clientHeight ) ) 
   {
      //IE 4 compatible
      myHeight = document.body.clientHeight;
   }

   if( myHeight < minHeight )
   {
      document.getElementById('flashcontainer').style.height = minHeight;
   }
   else
   {
      document.getElementById('flashcontainer').style.height = '100%';
   }
}
//
var pageRoot = "";

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()
{
	popScrollingWindow(pageRoot + "popups/register.html", 550, 550, "register");
}

function popTerms()
{
	popScrollingWindow(pageRoot + "http://www.paramountmovies.com/legal/termsofuse.php?bgcolor=000000&linkcolor=FFFFFF&fontcolor=CCCCCC", 550, 550, "terms");
}

function popPrivacy()
{
	popScrollingWindow(pageRoot + "http://www.paramountmovies.com/legal/privacypolicy.php?bgcolor=000000&linkcolor=FFFFFF&fontcolor=CCCCCC", 550, 550, "privacy");
}

function popTrailer()
{
	openWindow(pageRoot + "http://movies.yahoo.com/feature/shooter.html", 770, 540, "trailer");
}

function popBuddyIcons()
{
	popWindow(pageRoot + "im_icons/index.html", 500, 450, "aim");
}

function popWallpaper(number, size)
{
	if(size==1) {
		var size_num="800x600";
	}else if(size==2) {
		var size_num="1024x768";
	}else {
		size_num="1280x1024";
	}
	popWindow(pageRoot + "wallpaper/wallpaper.html?wallpaper=wallpaper_"+number+"_"+size_num+".jpg");
}

function popCredits()
{
	popWindow(pageRoot + "popups/credits.html", 770, 261, "credits");
}
