$(document).ready(function()
{
	$(  'body:not("#User,#Join") .content form:not(".login") label[for]+input[type="text"],' +
		'body:not("#User") .content form:not(".login") label[for]+input[type="password"],' +
		'body:not("#User") .content label[for]+textarea,' +
		'#sb-player label[for]+textarea,' +
		'form.search label[for]+input[type="text"]')
	.wrap('<div class=\"hover-wrap\" style=\"position:relative;"><\/div>')
	.live('focus',function(){$(this).prev().hide();})
	.live('blur',function(){if ( !this.value ) $(this).prev().show()})
	.each(function(){$(this).before( $(this).parent().prev() );
	if ( this.value ) $(this).prev().hide();});

	if ( $('ul.featured-films li').length >1 )
		{
			$('ul.featured-films li:eq(1)').addClass('current');
			$('ul.featured-films li').click(function(){
				if(!$(this).hasClass('current'))
				{
					$('ul.featured-films li.current img').fadeOut(500);
					$('ul.featured-films li').removeClass('current');
					$(this).find('img').fadeIn(500);
					$(this).addClass('current');
				}
			})
		}

	Shadowbox.init({
		overlayColor: '#929496'
		,overlayOpacity: '.95'
		,troubleElements: ["select", "object", "embed"]
		,enableKeys: false
	});

	$('.trailer-placeholder img').click(function() {
		$(this).hide();
		$('.trailer-placeholder iframe').show();
	})

	if ($('#Slider>ol>li').length > 1)
	{
		$('#Slider').append('<ul id="Pager"></ul>');
		$('#Slider>ol').cycle({
			fx: 'scrollHorz'
			,pause: 1
			,speed: 1500
			,timeout: 8000
			,pager: '#Pager'
			,pagerAnchorBuilder: function(idx, slide)
			{
				return '<li><a href="#" title="Slide #' + parseInt(idx+1) + '">' + parseInt(idx+1) + '<\/a><\/li>';
			}
		});
	}
	if( $('body.page .content>img+p>img').length > 0 ) {
		$('body.page .content>img:first-child').hide();
	}

});

