$(document).ready( function() {
	
	$('input[type=text]').focus( function() {
		if ( $(this).val() == $(this).attr('title') ) $(this).val('');
	}).blur( function() {
		if ( $(this).val() == '' ) $(this).val( $(this).attr('title') );
	}).each( function() {
		$(this).blur();
	});
	
	$('#login input[type=password]').blur( function() {		
		if ($(this).val() == '') {
			$(this).siblings('[name=_'+ $(this).attr('name')+']').show();
			$(this).hide();
		}
		
	}).each( function() {
		var realpw = this;
		
		$(this).hide();
		
		var fakepw = $('<input type="text" name="_'+$(this).attr('name')+'" title="Password" value="Password" />');
		
		$(fakepw).focus( function() {
			$(this).hide();
			$(realpw).show().focus();
		});
		
		$(this).after(fakepw);
		
		$(this).blur();
	});

	$('a.play-me').click( function() {
		$('.video').removeClass('closed').addClass('open');
		
		var params = { allowScriptAccess: "always", fs: 1, showinfo: 0 };
    	var atts = { id: "intro_video_player" };
		
		swfobject.embedSWF("http://www.youtube.com/v/rpEecSELOKc?enablejsapi=1&playerapiid=ytplayer", 
                       "intro_video", "636", "356", "8", null, null, params, atts);
		
		return false;
	});
	
	$('#video_controls a').click( function() {
		var seektime = $(this).attr('data-videoseek');
		intro_video_player.seekTo(seektime, true);
		return false;
	});
	
});
