	var active 	=	null;
	var timeOut	=	null;

$(document).ready( function() {
	
	
	
	
	function dJS(daString)
	{
		$('.debugJS').append(daString + '<br />');
	}
	
	
	
	$('.main-nav .li-level0').each( function() {
		var tmpID	=	$(this).attr('id').replace("sm", "");
		var tmpSTR	=	tmpID.substr(tmpID.length -2, 2);
		tmpID		=	tmpID.replace(tmpSTR, "");
		
		if ( $('.sub-menu-' + tmpID).length > 0 )
		{
			$(this).mouseenter( function() {
									if ( active != null )
									{
										active.fadeOut('fast');
										$('.sub-menu-' + tmpID).fadeIn();
									}
									else
									{
										$('.sub-menu-' + tmpID).slideDown();
										$('.main-nav').animate({ height: '120' });
									}
									active = $('.sub-menu-' + tmpID);
									return false;
								});
		}
		else 
		{
			$(this).mouseover( function() {
				if ( active != null )
				{
					active.fadeOut('fast');
					activate = null;
				}
			});
		}
	});
	
	$('.main-nav').mouseleave( function() {
		if ( active != null )
		{
			active.slideUp('fast');
			$('.main-nav').animate({ height: '60' });
			active = null;
		}
	});
	
	$(".filmstrip li").each( function() {
		$(this).mouseenter( function() {
			var toShow	=	$(this).children('.legend');
			toShow.fadeIn();
		});
		$(this).mouseleave( function() {
			var toShow	=	$(this).children('.legend');
			toShow.fadeOut();
		});
	});
	
	if ( $("#errorPad") )
	{
		$("#errorPad").click(function(){
			$(this).fadeOut();
			$("#erlogPad").fadeOut();
		});
		$("#erlogPad").click(function(){
			$(this).fadeOut();
			$("#errorPad").fadeOut();
		});
	}
	
	






});