<!--
function openClip( src )
	{
		openFlashClip( 'swf/clip.swf?src=/swf/clips/' + src, 'clip', 370, 400 );
	}

	function sendEcard( sEcard )
	{
		openPopup( 'ecards/index.html?' + sEcard, 'ecard', 400, 455 );			
	}
	
	function sendPhoto( sPhoto )
	{
		openPopup( 'photos/index.html?' + sPhoto, 'photo', 400, 417 );
	}
	
	function openEcard( src )
	{
		openFlash( src, 'ecards', 400, 500 );
	}				

	function openSlideShow( src )
	{
		openFlash( src, 'slideshows', 600, 440 );
	}				

	function openPoster()
	{
		openPopup( 'poster/poster.html', 'poster', 350, 580 );
	}				

	function openSneak()
	{
		openPopup( 'http://ads.newline.aol.com/cgi-bin/announcer_sneak.cgi?www.thenotebookmovie.com', 'sneak', 470, 300 );	
	}
	function sendPoster()
	{
		openPopup( 'poster/send.html', 'poster', 350, 580 );
	}				

	function openPosterInstructions()
	{
		openPopup( 'instructions.html', 'posterinstructions', 420, 340 );		
	}
	
	function openScreensaver( src )
	{
		openFlash( src, 'screensavers', 238, 179 );
	}			
	
	function openSweepstakes()
	{
		alert( 'sweepstakes' );
	}	

	function openMailingList() 
	{
		window.open( 'http://www.newline-movies.com/neareg0001/c?title=the_notebook&source=notebook_main_site', 'regpage','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=350,height=496');
	}

	function openTrailer()
	{
		openPopup( 'trailer/trailer.html?id=trailer&settings=true', 'trailer', 550, 550 );
	}
/*	
	function openTrailer( size )
	{
		var lWidth  = 800;
		var lHeight = 600;
		
		switch( size )
		{
			case "small":
				lWidth	= 300;
				lHeight = 250;
				break;
			case "medium":
				lWidth	= 370;
				lHeight = 290;
				break;
			case "large":
				lWidth	= 530;
				lHeight = 380;
				break;
		}
		
		openPopup( 'trailer/' + size + '.html', 'trailer' + size, lWidth, lHeight );
	}
*/	

	//------------------------------------------------------------
	// all of the items under this line are global across sites
	//------------------------------------------------------------
	
	is_underage = getCookie( 'coppa_cookie' ) == 'underage';

	prefix = '';
	if( location.pathname.substring( 0, 5 ) == '/dev/' )
	{
		prefix = '/dev';	
	}
	
	function stripSpaces(x)
	{
	    while (x.substring(0,1) == ' ') x = x.substring(1);
	    return x;
	}

	function isEmpty(x)
	{
		var test = stripSpaces(x);

		if( test.length > 0 )
			return false;
		else
			return true;
	}
	
	function isUnderage( min_age, birthday )
	{
		var today = new Date();
		var yesteryear = new Date();
		yesteryear.setYear(today.getYear()-min_age);

		var age = today.getTime() - birthday.getTime();
		var limit = today.getTime() - yesteryear.getTime();

		return (age < limit);
	}

	function validateViralForm( form )
	{

		if( isEmpty( form.email_recipientname.value ) )
		{
			alert('Please enter your friend’s first name.');
			form.email_recipientname.focus();
			return false;
		}
	
		if( isEmpty( form.email_recipientemail.value ) )
		{
			alert('Please enter your friend’s email.');
			form.email_recipientemail.focus();
			return false;
		}
			
		if( isEmpty( form.email_sendername.value ) )
		{
			alert('Please enter your first name.');
			form.email_sendername.focus();
			return false;
		}
	
		if( isEmpty( form.email_senderemail.value ) )
		{
			alert('Please enter your email.');
			form.email_senderemail.focus();
			return false;
		}	
		
		return true;
	}	

	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'+size, lWidth, lHeight );
		
		oWindow.document.write( '<html>' );
		oWindow.document.write( '	<head>' );
		oWindow.document.write( '		<title>The Notebook</title>' );
		oWindow.document.write( '	</head>' );
		oWindow.document.write( '	<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">' );
		oWindow.document.write( '		<img src="' + prefix + 'media/desktops/' + src + '_' + size + '.jpg" width="' + lWidth + '" height="' + lHeight + '" alt="">' );
		oWindow.document.write( '	</body>' );
		oWindow.document.write( '</html>' );
		
  	}
    
	function openFlash( src, asset, width, height )
	{
		var lWidth 			= width;
		var lHeight 		= height;
				
		var now = new Date();
		
		var oWindow = openPopup( '', 'EcardPreview' + now.getTime(), lWidth, lHeight );
		
		oWindow.focus();
			
		oWindow.document.writeln( '<html>');
		oWindow.document.writeln( '	<head>');
		oWindow.document.writeln( '		<title>The Notebook</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/' + asset + '/' + src + '.swf">');
		oWindow.document.writeln( '     <EMBED  SRC="' + prefix + 'media/' + asset + '/' + 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( '		<script language="javascript" src="/jscript/library.js"></script>' );
		oWindow.document.writeln( '	</body>');
		oWindow.document.writeln( '</html>');
	}

	function openFlashClip( src, asset, width, height )
	{
		var lWidth 			= width;
		var lHeight 		= height;
				
		var now = new Date();
		
		var oWindow = openPopup( '', 'clip' + now.getTime(), lWidth, lHeight );
		
		oWindow.focus();
			
		oWindow.document.writeln( '<html>');
		oWindow.document.writeln( '	<head>');
		oWindow.document.writeln( '		<title>The Notebook</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="' + src + '">');
		oWindow.document.writeln( '     <EMBED  SRC="' + src + '" 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( '		<script language="javascript" src="/jscript/library.js"></script>' );
		oWindow.document.writeln( '	</body>');
		oWindow.document.writeln( '</html>');
	}
    
	function openVideo( src, bandwidth )
	{
		//alert( src );
		var lWidth 			= 0;
		var lHeight 		= 0;
		var lVideoWidth 	= 0;
		var lVideoHeight 	= 0;	
		var sBackground		= "";
		
		switch( bandwidth )
		{
			case 100:
				lWidth	= 300;
				lHeight = 275;
				lVideoWidth	= 240;
				lVideoHeight = 148;
				sBackground = "background_clip_small.jpg";
				break;
			case 300:
				lWidth	= 370;
				lHeight = 325;
				lVideoWidth	= 320;
				lVideoHeight = 192;
				sBackground = "background_clip_medium.jpg";
				break;
			case 700:
				lWidth	= 530;
				lHeight = 425;
				lVideoWidth	= 480;
				lVideoHeight = 284;
				sBackground = "background_clip_large.jpg";
				break;
		}

		
		var now = new Date();
		var sName = 'video' + now.getTime();
			
		var oWindow = openPopup( '', sName, lWidth, lHeight );
		
		oWindow.focus();
			
		oWindow.document.writeln( '<html>' );
		oWindow.document.writeln( '	<head>' );
		oWindow.document.writeln( '		<title>The Notebook</title>' );
		oWindow.document.writeln( '	</head>' );
		oWindow.document.writeln( '	<body background="/trailer/images/' + sBackground + '" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >' );
		oWindow.document.writeln( '		<table cellspacing="0" cellpadding="0" width="100%" height="110%">' );
		oWindow.document.writeln( '			<tr>' );
		oWindow.document.writeln( '				<td align="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( '				</td>' );
		oWindow.document.writeln( '			</tr>' );
		oWindow.document.writeln( '		</table>' );
		oWindow.document.writeln( '	</body>' );
		oWindow.document.writeln( '</html>' );
	}    
    
	function openPopup( url, name, width, height, center )
	{
		var oWindow;
				
		if( center )
		{
			oWindow = window.open( prefix + 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( prefix + url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height );
		}
		
		return oWindow;
	}
	
	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 );
	}
	
	function setCookie( name, value, expires, path, domain, secure )
	{
	    document.cookie = 	name + "=" +escape(value) +
	        				( (expires) ? ";expires=" + expires.toGMTString() : "") +
	        				( (path) 	? ";path=" + path : "") +
	        				( (domain) 	? ";domain=" + domain : "") +
	        				( (secure) 	? ";secure" : "");
	}
	
	function stripSpaces(x)
	{
	    while (x.substring(0,1) == ' ') x = x.substring(1);
	    return x;
	}

	function isEmpty(x)
	{
		var test = stripSpaces(x);

		if( test.length > 0 )
			return false;
		else
			return true;
	}

	function isEmail(str)
	{
		  var nATposition = str.indexOf("@");
		  var ss = str.substring( nATposition);
		  return (ss.indexOf(".") > 1) && (str.indexOf("@") > 0) && ( str.indexOf("..") < 0);
	}

	function validateSweepstakes( form )
	{
		if( isEmpty( form.first_name.value ) )
		{
			alert('Please enter your first name.');
			form.first_name.focus();
			return false;
		}

		if( isEmpty( form.last_name.value ) )
		{
			alert('Please enter your last name.');
			form.last_name.focus();
			return false;
		}

		if( isEmpty( form.address.value ) )
		{
			alert('Please enter your address.');
			form.address.focus();
			return false;
		}

		if( isEmpty( form.city.value ) )
		{
			alert('Please enter your city.');
			form.city.focus();
			return false;
		}

		if( form.state.options[form.state.selectedIndex].value == "" )
		{
			alert('Please select your state.');
			form.state.focus();
			return false;
		}
		
		if( isEmpty( form.zip_code.value ) )
		{
			alert('Please enter your zip code.');
			form.zip_code.focus();
			return false;
		}

		if( !isEmail( form.email.value ) || isEmpty( form.email.value ) )
		{
			alert('Please enter your email address.');
			form.email.focus();
			return false;
		}

		if( form.birth_month.options[form.birth_month.selectedIndex].value == "" )
		{
			alert('Please select your birth month.');
			form.birth_month.focus();
			return false;
		}
		
		if( form.birth_day.options[form.birth_day.selectedIndex].value == "" )
		{
			alert('Please select your birth day.');
			form.birth_day.focus();
			return false;
		}
		
		if( stripSpaces( ( form.birth_year.value ) ).length != 4 )
		{
			alert('Please enter your four digit birth year.');
			form.birth_year.focus();
			return false;
		}


		return true;
	}	
//-->
