function landing_play()
{
	jQuery('#landing_player').show();
	jQuery('#landing_splash').hide();
	flowplayer("landing_player", "/swf/flowplayer.swf",  {
		// player configuration goes here
		clip: {
			url:'/swf/landing.f4v',
			autoPlay: true,
			autoBuffering: true,
			onFinish : function(){this.unload();landing_stop();}
		}
	});
	jQuery('.ltp-btn').addClass('close');
}

function landing_stop()
{
	jQuery('#landing_splash').show();
	jQuery('#landing_player').hide();
	if (typeof $f() == 'object')
		$f().stop();
	jQuery('.ltp-btn').removeClass('close');
}

(function($,$$) {
	$(function(){
		jQuery('#landing_player').hide();
		$('.ltp-btn').click(function(){
			var $this = $(this);
			if($this.hasClass('close'))
				landing_stop();
			else
				landing_play();
		});
		var $lir = $('#land-icons-rollover');
		$('.land-icon').each(function(){
			var $t = $(this), title = $t.attr('title');
			$t.removeAttr('title').hover(function(){
				$lir.text(title);
			},function(){
				$lir.text('roll over the icons above to see more');
			});
		});
		
		$('#join-today').click(function(){$$.widget.showAuth(true);});
		var $ovlp = $('<div>',{'id':'one-blurt-overlay-player'}).hide();
		$ovlp.append(
			$('<div>',{'id':'one-blurt-player-container'}),
			$('<a>',{'class':'close','href':'javascript:;',click:function(){
				$f().stop();
				$.unblockUI();
			}})
		);
		$ovlp.appendTo('body');

		//$('#stats').show();
		//flowplayer().play();
		$('#one-blurt-play').show().append($('<img/>',{src:'/img/play_small.png',click:function(){
			flowplayer("one-blurt-player-container", "/swf/flowplayer.swf",  {
				// player configuration goes here
				clip: {
					url:'/swf/landing.f4v',
					autoPlay: true,
					autoBuffering: true
				}
			});
			$.blockUI({
				message: $ovlp,
				overlayCSS:{ opacity:0.5, cursor:'default' },
				css : { left:'15%', top:'15%', border:'none', cursor:'default', width:'720px', height:'445px', backgroundColor:'white', borderRadius:'10px', '-webkit-box-shadow':'gray 0 0 5px' }
			});
		}}).css({'opacity':0.8,'cursor':'pointer'}).hover(function(){$(this).css('opacity',1)},function(){$(this).css('opacity',0.8)}));
	});
})(jQuery,blurts);
