﻿// JScript File



	

function displayLayer( whichLayer, displayValue )
{
	  var elem, vis;
	  if( document.getElementById ) // this is the way the standards work
			elem = document.getElementById( whichLayer );
	  else if( document.all ) // this is the way old msie versions work
			elem = document.all[whichLayer];
	  else if( document.layers ) // this is the way nn4 works
			elem = document.layers[whichLayer];
	  vis = elem.style;
	  
	  /// if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
			//displayValue = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'inline':'none';
			displayValue = 'inline';
	  
	  vis.display = displayValue;
}	

function updateCharCount( textField, displayArea, maxChars ){
	if ( textField.value.length > maxChars ){
		textField.value = textField.value.slice(0, maxChars);
	}
	displayArea.innerHTML = textField.value.length+" / "+maxChars + " characters";
	//alert(displayArea.innerHTML);
}
/* *********	masterpage	********* */
	function check()
	{
		return !(document.getElementById("__EVENTVALIDATION")==null) 
	} 

/* *********	Show movies	********* */			
	function ResetPlotLayers()
	{
		displayLayer('ShowPlotContent',			'none'); 
		displayLayer('RecommendMovieContent',	'none');											
		displayLayer('MovieReviewsContent',		'none');
		displayLayer('TellYourFriendsContent',		'none');
                displayLayer('tab4Content',		'none');
		ResetTabs(); 
	}
	function ShowLayer_Plot()			{ displayLayer('ShowPlotContent',		'inline'); }
	function ShowLayer_RecommendMovie() { displayLayer('RecommendMovieContent',	'inline'); }
	function ShowLayer_MovieReviews()	{ displayLayer('MovieReviewsContent',	'inline'); }
	function ShowLayer_Tab1()			{ displayLayer('tab1Content',	'inline'); }
	function ShowLayer_Tab2()			{ displayLayer('tab2Content',	'inline'); }
	function ShowLayer_Tab3()			{ displayLayer('tab3Content',	'inline'); }
	function ShowLayer_Tab4()			{ displayLayer('tab4Content',	'inline'); }
        function ShowLayer_TellYourFriends() { displayLayer('TellYourFriendsContent',	'inline'); }
        
	function ResetTabs()
	{
		document.getElementById('tab1').className = "";
		document.getElementById('tab2').className = "";
		document.getElementById('tab3').className = "";
		document.getElementById('tab4').className = "";
		document.getElementById('tab5').className = "";
	}

/* *********	User	********* */	
	function ResetUserLayers()
	{		
		displayLayer('tab1Content',		'none');
		displayLayer('tab2Content',		'none');
		ResetTabs(); 
	}

<!-- 

 -->