// JavaScript Document
$('document').ready(function(){init()});

function init(){
	//init help bubbles
	if($('#video_player')[0]){
		//$('#video_player').flash({src:'FLVPlayer_Progressive.swf', width:'335', height:'189', flashvars: { allowfullscreen: true }});
		
		var video = $('#FLVPlayer').clone(true);
		$('#FLVPlayer').remove();
	}
	$('#play_video').bind('click', function(){
														 var flash = false;
														 $('#video_player').append(video); 
														 flash = $('#video_player').flash({src:'FLVPlayer_Progressive.swf', 
																						  width:'335', 
																						  height:'189',
																						  salign: 'lt',
																						  quality: 'high',
																						  wmode: 'opaque',
																						  swfversion: '8,0,0,0',
																						  expressinstall: '../Scripts/expressInstall.swf',
																						  scale: 'noscale',
																						  flashvars: { 
																						  MM_ComponentVersion: 1,
																						  skinName: 'Clear_Skin_1',
																						  streamName: 'videos/video',
																						  autoPlay: true,
																						  autoRewind: false,
																						  allowfullscreen: true }});
														 
															$('#video_player').append('<video class="video-stream" autobuffer="autobuffer" src="videos/video.mp4" autoplay="autoplay" controls width="335" height="189"><img src="images/video_player.jpg" alt="" /></video>');
														});
														
	
	var ghost_labelled = $('.ghost_labelled');
	ghost_labelled.bind('focus', function(e){
											  if($(this).get(0).value == $(this).get(0).defaultValue){
												$(this).get(0).value = '';
												$(this).addClass('active');
											  }
										  });
	ghost_labelled.bind('blur', function(e){
											  if($(this).get(0).value == ''){
												$(this).get(0).value = $(this).get(0).defaultValue;
											  	$(this).removeClass('active');
											  }
										  });
}
