Event.observe(window, 'load', setLayout, useCapture = false);
Event.observe(window, 'load', favFiveSetup, useCapture = false);
Event.observe(window, 'resize', setLayout, useCapture = false);

var activeSeries = "NOT_ACTIVE";
activeSeries = 's00000259';	
var votingEnabled = false;

function setLayout() {
	var FBTFWindowHeight;
	if (self.innerHeight) {
		FBTFWindowHeight = self.innerHeight; // all except Explorer
	} else if (document.documentElement && document.documentElement.clientHeight) {
		FBTFWindowHeight = document.documentElement.clientHeight; // Explorer 6 Strict Mode
	} else if (document.body) {
		FBTFWindowHeight = document.body.clientHeight; // other Explorers
	}
	
	if (Prototype.Browser.IE) {
		offset = 0;
	} else {
		offset = 12;
	}
	
	var content = $('content');
	if ($('films')) {
		content = $('films');
		offset = offset+89;
		if (Prototype.Browser.IE) offset = offset+13;
	}
	
	if (FBTFWindowHeight > (content.getHeight() + $('pageSummary').getHeight() + $('header').getHeight() + $('footer').getHeight())) {
		content.style.height = (FBTFWindowHeight - ($('pageSummary').getHeight() + $('header').getHeight() + $('footer').getHeight() + offset)) + "px";
	}
}

function favFiveSetup() {
	$$("#picks a").each(function(item) {
		Event.observe(item, 'mouseover', function(){$('favFiveLabel').innerHTML=item.getElementsByClassName('description')[0].innerHTML});
		Event.observe(item, 'mouseout', function(){$('favFiveLabel').innerHTML="Five more great films to view"});
	});
}

function textLimit(field, maxlen) {
        if (field.value.length > maxlen + 1)
        alert('Your input has been truncated!');
        if (field.value.length > maxlen)
        field.value = field.value.substring(0, maxlen);
}
