<!--
// Ultimate client-side JavaScript client sniff. Version 3.03
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute.
// Revised 17 May 99 to add is_nav5up and is_ie5up (see below).
// Revised 20 Dec 00 to add is_gecko and change is_nav5up to is_nav6up
//                      also added support for IE5.5 Opera4&5 HotJava3 AOLTV
// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4, 
//                      correct Opera 5 detection
//                      add support for winME and win2k
//                      synch with browser-type-oo.js
// Revised 26 Mar 01 to correct Opera detection
// Revised 02 Oct 01 to add IE6 detection

// Everything you always wanted to know about your JavaScript client
// but were afraid to ask. Creates "is_" variables indicating:
// (1) browser vendor:
//     is_nav, is_ie, is_opera, is_hotjava, is_webtv, is_TVNavigator, is_AOLTV
// (2) browser version number:
//     is_major (integer indicating major version number: 2, 3, 4 ...)
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
// (3) browser vendor AND major version number
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav6, is_nav6up, is_gecko, is_ie3,
//     is_ie4, is_ie4up, is_ie5, is_ie5up, is_ie5_5, is_ie5_5up, is_ie6, is_ie6up, is_hotjava3, is_hotjava3up,
//     is_opera2, is_opera3, is_opera4, is_opera5, is_opera5up
// (4) JavaScript version number:
//     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
// (5) OS platform and version:
//     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98, is_winme, is_win2k
//     is_os2
//     is_mac, is_mac68k, is_macppc
//     is_unix
//     is_sun, is_sun4, is_sun5, is_suni86
//     is_irix, is_irix5, is_irix6
//     is_hpux, is_hpux9, is_hpux10
//     is_aix, is_aix1, is_aix2, is_aix3, is_aix4
//     is_linux, is_sco, is_unixware, is_mpras, is_reliant
//     is_dec, is_sinix, is_freebsd, is_bsd
//     is_vms
//
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
// for detailed lists of userAgent strings.
//
// Note: you don't want your Nav4 or IE4 code to "turn off" or
// stop working when new versions of browsers are released, so
// in conditional code forks, use is_ie5up ("IE 5.0 or greater") 
// is_opera5up ("Opera 5.0 or greater") instead of is_ie5 or is_opera5
// to check version in code which you want to work on future
// versions.

    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_webtv = (agt.indexOf("webtv") != -1); 

    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;

    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  

    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));

    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 || 
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    var is_os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));

    var is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (is_mac && is_ie5up) is_js = 1.4;
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));

    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);    
    var is_aix2  = (agt.indexOf("aix 2") !=-1);    
    var is_aix3  = (agt.indexOf("aix 3") !=-1);    
    var is_aix4  = (agt.indexOf("aix 4") !=-1);    
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
    var is_mpras    = (agt.indexOf("ncr")!=-1); 
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
                 is_sco ||is_unixware || is_mpras || is_reliant || 
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);

    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));



	var baseVersion 	= 5;
	var flashVersion	= 0;
	var is_flash3 		= false;
	var is_flash4 		= false;
	var is_flash5 		= false;
	var is_flash6 		= false;
	var is_flash		= false;
	
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	
	if ( plugin ) 
	{
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for( var i = 0; i < words.length; ++i )
	    {
			
			if( isNaN( parseInt( words[i] ) ) )
				continue;
			
			if( words[i] == 3 )
				is_flash3 = true;
			if( words[i] == 4 )
				is_flash4 = true;
			if( words[i] == 5 )
				is_flash5 = true;
			if( words[i] == 6 )
				is_flash6 = true;
			flashVersion = words[i]; 
	    }	    
	}
	else if( navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && ( navigator.appVersion.indexOf("Win") != -1 ) )
	{
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('is_flash3 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
		document.write('is_flash4 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
		document.write('is_flash5 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
		document.write('is_flash6 = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
		document.write('</SCR' + 'IPT\> \n');

		if( is_flash3 ) flashVersion = 4;
		if( is_flash4 ) flashVersion = 4;
		if( is_flash5 ) flashVersion = 5;
		if( is_flash6 ) flashVersion = 6;
	}

	//alert( is_flash3 + ':' + is_flash4 + ':' + is_flash5 + ':' + is_flash6 );
    if( flashVersion >= baseVersion )
    {
    	is_flash = true;
    }
	
	//check for underage
	is_underage = getCookie( 'coppa_cookie' ) == 'underage';

	// popup windows and assorted other functions
	function printPronunciation( sWord, oDocument )
	{
		//oDocument.writeln( sWord );
		oDocument.writeln( '<OBJECT ');
		oDocument.writeln( '	classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	 	oDocument.writeln( '	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	 	oDocument.writeln( '	WIDTH="17" ');
	 	oDocument.writeln( '	HEIGHT="12" ');
	 	oDocument.writeln( '	id="speaker" ');
	 	oDocument.writeln( '	ALIGN=""');
	 	oDocument.writeln( '>');
	 	oDocument.writeln( '	<PARAM NAME=movie VALUE="/pronunciation/swf/speaker.swf?clip=/pronunciation/swf/' + sWord + '.swf">');
	 	oDocument.writeln( '	<PARAM NAME=quality VALUE=high>');
	 	oDocument.writeln( '	<PARAM NAME=bgcolor VALUE=#FFFFFF>');
	 	oDocument.writeln( '	<EMBED 	');
	 	oDocument.writeln( '		src="/pronunciation/swf/speaker.swf?clip=/pronunciation/swf/' + sWord + '.swf" ');
	 	oDocument.writeln( '		quality=high ');
	 	oDocument.writeln( '		bgcolor=#FFFFFF  ');
	 	oDocument.writeln( '		WIDTH="17" ');
	 	oDocument.writeln( '		HEIGHT="12" ');
	 	oDocument.writeln( '		NAME="speaker" ');
	 	oDocument.writeln( '		ALIGN=""');
	 	oDocument.writeln( '		TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	 	oDocument.writeln( '	</EMBED>');
		oDocument.writeln( '</OBJECT>');		
	}
	
	function openTimedPopup( url, name, width, height, center )
	{
		if( center )
		{
			setTimeout("window.open('" + url + "','" + name + "','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + width + ",height=" + height + ",top=" + (( screen.height - height )/2) + ",left=" + (( screen.width - width )/2 ) + "' );",500);
		}
		else
		{
			setTimeout("window.open('" + url + "','" + name + "','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + width + ",height=" + height + "' );",500);
		}
	}
	
	function openPopup( url, name, width, height, center )
	{
		var oWindow;
		
		if( center )
		{
			oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height + ',top=' + (( screen.height - height )/2) + ',left=' + (( screen.width - width )/2 ) );
		}
		else
		{
			oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height );
		}
		
		return oWindow;
	}
	
	function openWindow( url, name )
	{
		window.open( url, name );
	}
	
	function openScrollingPopup( url, name, width, height, center )
	{
		if( center )
		{
			window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height + ',top=' + (( screen.height - height )/2) + ',left=' + (( screen.width - width )/2 ) );
		}
		else
		{
			window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height );
		}
	}
	
	function PopupFullOption( url, name )
	{
		var width= screen.width / 1.4 ;
		var height= screen.height/ 1.4;
		var center = 0;
		if( center )
		{
			window.open( url, name,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=' + width + ',height=' + height + ',top=' + (( screen.height - height )/2) + ',left=' + (( screen.width - width )/2 ) );
		}
		else
		{
			window.open( url, name,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=' + width + ',height=' + height );
		}
	}
	
	function openScreensaver( src, size)
	{
		var lWidth 			= 320;
		var lHeight 		= 240;
				
		var now = new Date();
		
		var oWindow = openPopup( '', 'Preview' + now.getTime(), lWidth, lHeight );
		
		oWindow.focus();
			
		oWindow.document.writeln( '<html>');
		oWindow.document.writeln( '	<head>');
		oWindow.document.writeln( '		<title>The Lord of the Rings</title>');
		oWindow.document.writeln( '		<style>');
		oWindow.document.writeln( '		<!--');
		oWindow.document.writeln( '			.copyright');
		oWindow.document.writeln( '			{');
		oWindow.document.writeln( '				FONT-FAMILY: arial, helvetica, sans-serif;');
		oWindow.document.writeln( '				FONT-SIZE: 10px;');
		oWindow.document.writeln( '			}');
		oWindow.document.writeln( '		//-->');
		oWindow.document.writeln( '		</style>');
		oWindow.document.writeln( '	</head>');
		oWindow.document.writeln( '	<body bgcolor="#ffffff" marginheight="0" topmargin="0" marginwidth="0" leftmargin="0">');
		oWindow.document.writeln( '	<center>');
		oWindow.document.writeln( '     <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="100%" HEIGHT="100%" NAME="sw" ID="sw">');
		oWindow.document.writeln( '     <PARAM NAME="Play" VALUE="true">');
		oWindow.document.writeln( '     <PARAM NAME="Loop" VALUE="true">');
		oWindow.document.writeln( '     <param NAME="Quality" VALUE="high">');
		oWindow.document.writeln( '     <param NAME="scale" VALUE="showall">');
		oWindow.document.writeln( '     <PARAM NAME="MENU" VALUE="FALSE">');
		oWindow.document.writeln( '     <PARAM NAME="SRC" VALUE="/media/screensavers/' + src + '.swf">');
		oWindow.document.writeln( '     <EMBED  SRC="/media/screensavers/' + src + '.swf" MENU="FALSE" scale="showall" WIDTH="100%" HEIGHT="100%" type="application/x-shockwave-flash" movie="'+ src +'.swf" quality="best" play="true" loop="true"></embed>');
		oWindow.document.writeln( '     </OBJECT>');

		oWindow.document.writeln( '	</body>');
		oWindow.document.writeln( '</html>');
	}
	
	function openDesktop( src, size )
	{
		var lWidth	= 800;
		var lHeight = 600;
		
		switch( size )
		{
			case "800x600":
				lWidth	= 800;
				lHeight = 600;
				break;
			case "1024x768":
				lWidth	= 1024;
				lHeight = 768;
				break;
			case "1280x1024":
				lWidth	= 1280;
				lHeight = 1024;
				break;
		}
		
		var oWindow = openPopup( '', 'desktop', lWidth, lHeight );
		
		oWindow.document.write( '<html>' );
		oWindow.document.write( '	<head>' );
		oWindow.document.write( '		<title>Lord of the Rings Desktop</title>' );
		oWindow.document.write( '	</head>' );
		oWindow.document.write( '	<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">' );
		oWindow.document.write( '		<img src="/media/desktops/' + src + '_' + lWidth + '.jpg" width="' + lWidth + '" height="' + lHeight + '" alt="">' );
		oWindow.document.write( '	</body>' );
		oWindow.document.write( '</html>' );
		
	}
	
	function openVideo( src, small )
	{
		
		var lWidth 			= 0;
		var lHeight 		= 0;
		var lVideoWidth 	= 0;
		var lVideoHeight 	= 0;	
		
		if( small )
		{
			lWidth 			= 270;
			lHeight 		= 300;
			lVideoWidth 	= 210;
			lVideoHeight 	= 200;	
		}
		else
		{	
			lWidth 			= 350;
			lHeight 		= 350;
			lVideoWidth 	= 320;
			lVideoHeight 	= 256;	
		}
		
		var now = new Date();
		
		var oWindow = openPopup( '', 'video' + now.getTime(), lWidth, lHeight );
		
		oWindow.focus();
			
		oWindow.document.writeln( '<html>');
		oWindow.document.writeln( '	<head>');
		oWindow.document.writeln( '		<title>The Lord of the Rings</title>');
		oWindow.document.writeln( '		<style>');
		oWindow.document.writeln( '		<!--');
		oWindow.document.writeln( '			.copyright');
		oWindow.document.writeln( '			{');
		oWindow.document.writeln( '				FONT-FAMILY: arial, helvetica, sans-serif;');
		oWindow.document.writeln( '				FONT-SIZE: 10px;');
		oWindow.document.writeln( '			}');
		oWindow.document.writeln( '		//-->');
		oWindow.document.writeln( '		</style>');
		oWindow.document.writeln( '	</head>');
		oWindow.document.writeln( '	<body bgcolor="#ffffff" marginheight="14" topmargin="14" marginwidth="0" leftmargin="0" text="#000000" link="#0e50b5" alink="#e82323" vlink="#990000" background="/images/qtbg2.jpg">');
		oWindow.document.writeln( '	<center>');
		oWindow.document.writeln( '		<embed ');
		oWindow.document.writeln( '			width="' + lVideoWidth + '" ');
		oWindow.document.writeln( '			height="' + lVideoHeight + '" ');
		oWindow.document.writeln( '			src="' + src + '" ');
		oWindow.document.writeln( '			controller="true" ');
		oWindow.document.writeln( '			border="0" ');
		oWindow.document.writeln( '			pluginspage="http://www.apple.com/quicktime/download/index_t.html" ');
		oWindow.document.writeln( '			autostart="true">');
		oWindow.document.writeln( '		</embed><br>');
		oWindow.document.writeln( getCopyright() );
		oWindow.document.writeln( '	</body>');
		oWindow.document.writeln( '</html>');
		
	}
	function openNewZealandMap()
	{
		//openPopup( '/purenz/competition_map.html' , 'nzsweepstakes' , 300, 500, true );
		  if ( is_flash )
		  {
		  	openPopup( '/purenz/flash_map/microsite_map.html' , 'nzsweepstakes', 300, 500, true );
		  }
		  else
		  {
		  	openPopup( '/purenz/noflash_map/noflash_map.html' , 'nzsweepstakes', 300, 500, true );
		  }
	}
	
	function openTwoTowerMod()
	{
		openPopup( '/two_towers/two_towers.html', 'towersmodwindow', 650, 450, true );
	}
	function openHelmsDeep()
	{
		if ( is_flash )
		{
			openPopup( '/effects/helmsdeep_frame.html', 'helmsdeepinsidetheeffects', 700, 500, true );
		}
		else
		{
			alert('Flash Player 6 is required to view this page.');
		}
	}	
	function openEffects()
	{
		if ( is_flash )
		{
			openPopup( '/effects/prologue_frame.html', 'insidetheeffects', 700, 500, true );
		}
		else
		{
			alert('Flash Player 6 is required to view this page.');
		}
	}
	function openVideoHelmsDeep()
	{
		// don't have video link yet. 
		openVideo( 'http://a772.g.akamai.net/5/772/51/3e78a2c0744610/1a1a1aaa2198c627970773d80669d84574a8d80d3cb12453c02589f25382f668c9329e0375e81785ea61cd36a40938ac1479d84cc332910574eb50c23564c63aad/ttt_helms_keep_m320.mov' );
	}
	
	function openVideoArms()
	{
		//don't have link yet
		openVideo('http://a772.g.akamai.net/5/772/51/3e78a2c0744610/1a1a1aaa2198c627970773d80669d84574a8d80d3cb12453c02589f25382f668c9329e0375e81785ea61cd36a40938ac1479d84cc332910574eb50c23564c63aad/ttt_arms_and_armor_m320.mov');
	}
	
	function openAnnouncementEvent()
	{
		openPopup( '/film/exclusives/home_ent_announce/home_ent_announce.html', 'announcewindow', 550, 400, false );
	}
	
	function openDesktopInstructions()
	{
		openScrollingPopup( '/legend/downloads/dsktp_instruct.html', 'desktopinstructions', 490, 480, false );
	}
	
	function openScreensaverInstructions()
	{
		openScrollingPopup( '/legend/downloads/scrsvr_instruct.html', 'desktopinstructions', 485, 480, false );
	}
	function openConstructionSendToFriend()
	{
		openPopup( '/legend/lands/edoras/construction_send.html','constructionsendtofriend', 350, 380, false);
	}
	function openSetSendToFriend()
	{
		openPopup( '/legend/lands/edoras/set_send.html','setsendtofriend', 350, 380, false);
	}
	function openEffectsSendToFriend()
	{
		openPopup( '/effects/effects_send.html', 'effectssendtofriend', 350, 380, false);
	}
	function openHelmsDeepSendToFriend()
	{
		openPopup( '/effects/helmsdeep_send.html', 'helmsdeepeffectssendtofriend', 350, 380, false);
	}
	
	function openIsengardMiniatureSendToFriend()
	{
		openPopup( '/legend/lands/isengard/miniature_send.html', 'miniaturesendtofriend', 350, 380, false);
	}
	
	function openIsengardSendToFriend()
	{
		openPopup( '/legend/lands/isengard/index_send.html', 'introsendtofriend', 350, 380, false);
	}
	
	
	function openFangornSendToFriend()
	{
		openPopup( '/legend/lands/fangorn/davies_send.html','fangornsendtofriend', 350, 380, false);
	}
	function openFangornTaylorSendToFriend()
	{
		openPopup( '/legend/lands/fangorn/taylor_send.html','fangorn3sendtofriend', 350, 380, false);
	}
	function openFangornTreeBeardSendToFriend()
	{
		openPopup( '/legend/lands/fangorn/standing_send.html','fangorn2sendtofriend', 350, 380, false);
	}
	function openDeadMarshSendToFriend()
	{
		openPopup( '/legend/lands/deadmarshes/index_send.html','deadmarshsendtofriend', 350, 380, false);
	}
	function openHelmsDeepIndexSendToFriend()
	{
		openPopup( '/legend/lands/helmsdeep/index_send.html', 'indexsendtofriend', 350, 380, false);
	}
	function openVisualEffectSendToFriend()
	{
		openPopup( '/legend/lands/helmsdeep/visualeffect_send.html','visualeffectsendtofriend', 350, 380, false);
	}
	function openStuntSendToFriend()
	{
		openPopup( '/legend/lands/helmsdeep/stunt_send.html','stuntsendtofriend', 350, 380, false);
	}
	function openEditorialSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/send.html', 'editorialsendtofriend', 350, 380, false );		
	}
	
	function openEditorialBecomegollumSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/becomegollum_send.html', 'sendtofriendbecomegollum', 350, 380, false );		
	}
	function openEditorialBeyondEffectsSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/beyondeffects_send.html', 'sendtofriendbeyondeffect', 350, 380, false );		
	}
	function openEditorialGoingDeepSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/goingdeep_send.html', 'sendtofriendgoingdeep', 350, 380, false );		
	}
	function openEditorialGollumSmeagolSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/gollumsmeagol_send.html', 'sendtofriendgollumsmeagol', 350, 380, false );		
	}
	function openEditorialFinishSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/finished_send.html', 'sendtofriendfinished', 350, 380, false );		
	}
	function openEditorialGandalfSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/gandalf_send.html', 'editorialgandalfsendtofriend', 350, 380, false );		
	}
	function openEditorialPeterjacksonFellowshipSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/peterjackson_fellowship_send.html', 'editorialpeterjacksonpart1sendtofriend', 350, 380, false );		
	}
	function openEditorialPeterjacksonDVDSendToFriend()
	{
		openPopup( '/film/exclusives/editorial/peterjackson_dvd_send.html', 'editorialpeterjacksonpart2sendtofriend', 350, 380, false );		
	}
	function openSoundtrackSendToFriend()
	{
		if( is_ie )
		{
			openPopup( '/join/soundtrack/send.html', 'soundtracksendtofriend', 350, 380, false );		
		}
		else
		{
			openPopup( '/join/soundtrack/send.html', 'soundtracksendtofriend', 350, 417, false );		
		}
	}
	
	function openSarumanWormtongueVideo()
	{
		openPopup( '/media/video/saruman_wormtongue.html', 'sarumanwormtonguevideo', 270, 300, false );		
	}

	function openTwoTowersPosterInstructions()
	{
		openPopup( '/film/exclusives/poster/instructions.html', 'twotowersposterinstructions', 420, 340, false );		
	}
	
	function openTwoTowersPoster()
	{
		openPopup( '/film/exclusives/poster/index.html', 'twotowersposter', 420, 675, true );		
	}
	
	function openTwoTowersPosterSend()
	{
		openPopup( '/film/exclusives/poster/send.html', 'twotowerspostersend', 420, 340, true );		
	}
	
	function openTwoTowersTrailer()
	{
		openPopup( '/two_towers/trailer/tt_trailer1.html', 'theatricaljumpwindow', 700, 515, true );		
	}

	function openTwoTowersTrailerBandwidth()
	{
		openPopup( '/two_towers/trailer/tt_trailer2.html', 'theatricaljumpwindow', 700, 515, true );		
	}

	function openTwoTowersFrameByFrame()
	{
		openPopup( '/join/realchannel/tt_framebyframe/lotr_frames.html', 'framebywindow', 640, 530, true );
	}

	function openDVDPreview()
	{
		openPopup( '/media/video/dvdpreview.html', 'dvdpreview', 360, 350, true );
	}

	function openTwoTowersTrailerInstructions()
	{	
		openScrollingPopup( 'instructions.html','instructions', 350, 300, false );
	}

	function popGuideHobb() 
	{
		var guidehobbwindow = openPopup('/guide/index_hobb.html', 'guidehobbwindow', 260, 430, false );
	}

	function popGuideMen() 
	{
		var guidemenwindow = openPopup('/guide/index_men.html', 'guidemenwindow', 260, 430, false );
	}

	function popGuideRing() 
	{
		var guideringwindow = openPopup('/guide/index_ring.html', 'guideringwindow', 260, 430, false );
	}

	function popGuideElves() 
	{
		var guideelveswindow = openPopup('/guide/index_elves.html', 'guideelveswindow', 260, 430, false );
	}

	function popGuideDwarves() 
	{
		var guidedwarveswindow = openPopup('/guide/index_dwarves.html', 'guidedwarveswindow', 260, 430, false );
	}
	
	function popGuideOrcs() 
	{
		var guideorcswindow = openPopup('/guide/index_orcs.html', 'guideorcswindow', 260, 430, false );
	}
	
	function popGuideWizards() 
	{
		var guidewizardsswindow = openPopup('/guide/index_wizards.html', 'guidewizardswindow', 260, 430, false );
	}
	
	function popGuideHorses() 
	{
		var guidehorseswindow = openPopup('/guide/index_horses.html', 'guidehorseswindow', 260, 430, false );
	}
	
	function popGuideEnts() 
	{
		var guideentswindow = openPopup('/guide/index_ents.html', 'guideentswindow', 260, 430, false );
	}
	
	function OpenHobbiton() 
	{
		var hobbitonwindow = openPopup( '/legend/lands/hobbiton/hobbiton.html', 'popwindow', 500, 380, false );
	}
	
	function OpenBree() 
	{
		var breewindow = openPopup('/legend/lands/bree/bree.html', 'breewindow', 500, 400, false );
	}
	
	function OpenWeathertop() 
	{
		var weathertopwindow = openPopup('/legend/lands/weathertop/weathertop.html', 'weathertopwindow', 500, 400, false );
	}
	
	function OpenRivendell() 
	{
		var rivendellwindow = openPopup('/legend/lands/rivendell/rivendell.html', 'rivendellwindow', 500, 400, false );
	}
	
	function OpenMoria() 
	{
		var moriawindow = openPopup('/legend/lands/moria/moria.html', 'moriawindow', 500, 400, false );
	}
	
	function OpenLothlorien() 
	{
		var lothlorienwindow = openPopup('/legend/lands/lothlorien/lothlorien.html', 'lothlorienwindow', 500, 400, false );
	}
		
	function changeHeaderImage( src )
	{
		if( parent.headerframe ) 
		{
			parent.headerframe.changeImages('header_flat_fi_hdr', src);
		}
	}

	function goToLocation( sLocation )
	{
		var target_x = 0;
		var target_y = 0;
		
		switch( sLocation )
		{
			case "Shire" :
				target_x = 2;
				target_y = .1;
				break;
			case "Bree" :
				target_x = -56;
				target_y = -26.9;
				break;
			case "Weathertop" :
				target_x = -95;
				target_y = .9;
				break;
			case "Rivendell" :
				target_x = -202;
				target_y = -1.1;
				break;
			case "Moria" :
				target_x = -208;
				target_y = -105;
				break;
			case "Lorien" :
				target_x = -259;
				target_y = -137;
				break;
		}
	
		if( window.document.EpicNavigation )
		{
			window.document.EpicNavigation.SetVariable( "target_x", target_x );
			window.document.EpicNavigation.SetVariable( "target_y", target_y );
		}
	}

	function getCopyright( paragraphmarks, linebreaks )
	{
		var sResult = '';
		
		if( paragraphmarks )
			sResult += '<p align="center" class="copyright">';
		else
			sResult += '<font align="center" class="copyright">';
			
		sResult += '	<a href="http://www.newline.com/privacy/privacy1.html" target="_blank">Privacy Policy</a> ';
		sResult += '	| ';
		sResult += '	<a href="http://www.newline.com/termsofuse/index.html" target="_blank">Terms of Use</a><br>';
		sResult += '	© 2002 New Line Productions, Inc.  The Lord of the Rings, The Two Towers, and the characters, events, items, ';
		
		if( linebreaks )
			sResult += '<br>';
			
		sResult += '	and places therein are trademarks of The Saul Zaentz Company d/b/a Tolkien Enterprises under license to ';

		if( linebreaks )
			sResult += '<br>';

		sResult += '	New Line Productions, Inc.  All Rights Reserved.<br>';
		
		if( paragraphmarks )
			sResult += '</p>';
		else
			sResult += '</font>';
			
		
		return sResult;
	}	
	
	function getFilmMenu( page )
	{
		var sResult = '';
		var sCast ='';
		var sFilm = '';
		var sProduction = '';
		sCast = sCast + '<img src="/flatsiteimages/star.gif" border="0" width="14" height="14">';
		if ( is_flash) 
		{
			sCast = sCast +  '<a target="_top" href="/index_cast.html"><img src="/flatsiteimages/cast.gif" border="0"></a>';
		}
		else
		{
			sCast = sCast +  '<a target="_top" href="/index_flat_film.html"><img src="/flatsiteimages/cast.gif" border="0"></a>';		
		}
		
		sFilm = sFilm +  '<img src="/flatsiteimages/star.gif" border="0" width="14" height="14">';
		
		if ( is_flash) 
		{
			sFilm = sFilm +  '<a target="_top" href="/index_filmmakers.html"><img src="/flatsiteimages/filmmaker.gif" border="0"></a>';
		}
		else
		{
			sFilm = sFilm +  '<a target="_top" href="/index_flat_filmmakers.html"><img src="/flatsiteimages/filmmaker.gif" border="0"></a>';
		}
		
		sProduction = sProduction +  '<img src="/flatsiteimages/star.gif" border="0" width="14" height="14">';
		
		if ( is_flash)
		{
			sProduction = sProduction +  '<a target="_top" href="/index_production.html"><img src="/flatsiteimages/production.gif" border="0"></a>';		
		}
		else
		{
			
			sProduction = sProduction +  '<a target="_top" href="/index_flat_production.html"><img src="/flatsiteimages/production.gif" border="0"></a>';		
		}
		
		if ( page == 'cast')
		{
			sCast = '';
		}
		if(page == 'filmmaker')
		{
			sFilm = '';
		}		
		if( page == 'production')
		{
			sProduction = '';
		}
		sResult = sCast + sFilm + sProduction;
		sResult = '<table cellspacing="0" cellpadding="0" width="100%"><tr><td align="right">' + sResult + '</td></tr></table>';
		
		return sResult;
	}	
	
	function printCopyright( linebreaks )
	{		
		document.write( getCopyright( true, linebreaks ) );
	}

	function printFilmMenu( page )
	{
		document.write( getFilmMenu(page) );
	}
	
	function getCookie( sName )
	{
	    var start 	= document.cookie.indexOf( sName + "=" );
	    var len 	= start + sName.length+1;
	    
	    if( ( !start ) && ( sName != document.cookie.substring( 0, sName.length ) ) ) 
	    	return null;
	    	
	    if( start == -1 ) 
	    	return null;
	    	
	    var end 	= document.cookie.indexOf(";",len);
	    
	    if( end == -1 )
	    	end = document.cookie.length;
	    	
	    return document.cookie.substring( len, end );
	}


	// legacy code 
	function OpenCom()
		{
	OpenNewPage('community_age.html','community','700','350');
	
		}
	
	
	function OpenEmail(page,windowname,horz,vert) {
		window.open(page, windowname,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width='+horz+',height='+vert );
	}
	
	function Open(page,windowname,horz,vert) {
		window.open(page, windowname,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + horz + ',height=' + vert );
	}
	
	function OpenNewPage(page,name,horz,vert) {
		OpenWin = window.open(page,name,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=' + horz + ',height=' + vert );
	}
	
	
	function cannesvid() {
	
	Open('legend/lands/cannes/la_cannes_index_exclusive.html','cannesmodule','650','452');
	
	
	
	//location.replace('http://www.film.com/RGX/FC.lotr..._nwl.RGX/ramhurl.film.com/smildemohurl.ram?file=channels/lotr/feature_aol.smi');

	}

	
	
	
	function popInter() {
	
	interwindow = window.open('international/international.html', 'windownamehere','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=412,height=378');
	}
	
	
	function popTattoo() {
	
	tattoowindow = window.open('tattoo/tattoo.html', 'tattoowindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=320,height=418');
	}
	
	
	function cannespop() {
		canneswindow = window.open('/legend/lands/cannes/la_cannes_jumper.html', 'cannesmodule','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=650,height=452');
		}


	function OpenIpix1() {
	var pop3 = window.open("/legend/ipix/ipix1.html","popwindow","width=320,height=332,status=1,toolbar=0,directories=0,menubar=0,resizable=0,location=0,scrollbars=0,copyhistory=0");
	
	}
		
			
	
	function popBweld() {
	
	weldonwindow = window.open('/bweld/bweld_pop.html', 'weldonwindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=320,height=425');
	}
	
	function popPoster2() {
	
	poster2window = window.open('/fotrteaser2.html', 'poster2window','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=480');
	}
	
	
	function popPoster3() {
	
	poster3window = window.open('/fotrposter.html', 'poster3window','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=480');
	}
	
	
	function popFeedback() {
	
	feedbackwindow = window.open('feedback.html', 'feedbackwindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=575,height=280');
	}
	
	function popCredits() {
	
	creditswindow = window.open('credits/credits.html', 'creditswindow','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=336,height=320');
	}
	
	
	function popTheatricaljump() {
	
	theatricaljumpwindow = window.open('two_towers/teaser/tt_teaser1.html', 'theatricaljumpwindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=515');
	}
	
	
	function popFanclub() {
	
	fanclubwindow = window.open('http://www.lotrfanclub.com/', 'fanclubwindow','toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=770,height=510');
	}
	
	
	function popSoundtrack() {
	
	soundtrackwindow = window.open('http://www.lordoftherings-soundtrack.com/', 'soundtrackwindow','toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=600,height=510');
	}
	
	function popEvites() {
	
	eviteswindow = window.open('http://newline.evite.com/compose?type=Lord_Of_The_Rings', 'eviteswindow','toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=750,height=450');
	}
	
	function popAwards() {
	
	awardswindow = window.open('http://www.newlineawards.com/popup/index.htm', 'awardswindow','toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=750,height=450');
	}
	
	function popElvish() {
	
	elvishwindow = window.open('http://www.elvishtranslator.com/index_postcards.html', 'elvishwindow','toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=750,height=450');
	}
	
	function popPJ() {
	
	peterjack = window.open('media/video/pj_twotowers.html', 'pjvideo','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=350,height=270');
	}
	
	function popTTmodule() {
	
	towersmodule = window.open('two_towers/two_towers.html', 'twotowers','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=650,height=450');
	}
	
	
	

function popEmail() {
	
	
	emailwindow = window.open('http://www.clickaction.net/ClickAction?subscriber?c=1&p=16906&i=2&func=S_survey', 'emailwindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=440,height=400');

	}

function f () {
	win = window.open('chat/index.php', '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, resizeable=yes, width=397, height=350, screenX=300,screenY=210,left=300,top=210');
	if (window.focus) {win.focus()}
	return false;
}
	


//-->