/* Home page scripts */

var current = null;	

var flashVideos = [
	"Get_Support_1_HOMEPAGE",
	"Local_Services_2_HOMEPAGE",
	"Patches_Gum_and_More_3_HOMEPAGE",
	"Together_Programme_4_HOMEPAGE",
	"Helpline_5_HOMEPAGE"
];

var transcripts = [
	"why_get_support.pdf",
	"local_services.pdf",
	"patches_gum_and_more.pdf",
	"support_in_your_home.pdf",
	"nhs_smoking_helpline.pdf"
];

var mpgVideos = [
	"Get_Support_1_mpeg1.mpg",
	"Local_Services_2_mpeg1.mpg",
	"Patches_Gum_and_More_3_mpeg1.mpg",
	"Together_Programme_4_mpeg1.mpg",
	"Helpline_5_mpeg1.mpg"
];

var videoPath = "/flash/videos/";

// Hide e-mail form outcome messages.
$('#stafSendingFailed').hide();
$('#stafSendingOk').hide();

$(document).ready(function() {	
	// Put video object in the container.
	$('#videoContainer').html(AC_FL_GetObjectContent(
		'codebase', 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
		'width', '311',
		'height', '270',
		'quality', 'high',
		'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'noScale',
		'wmode', 'opaque',
		'devicefont', 'false',
		'id', 'mainplayer',
		'bgcolor', '#FFFFFF',
		'name', 'mainplayer',
		'menu', 'false',
		'allowScriptAccess','always',
		'swliveconnect', 'true',
		'movie', '/flash/videos/MainPlayer2',
		'flashvars','videoname=' + videoId,
		'salign', ''
	));
	
	// Hide tabs.
	$("#videoLinks").remove();

	// Enable the video. 
	$('#videoContainer object').addClass('on');

	// Auto-play if requested.
	//if (videoId) {
		//setTimeout(function(){playFlashMovie('mainplayer', videoId)}, 2000);
		//onVideoSelected(videoId);
	//} else {
		// Update the video-related links.
		onVideoSelected(1);
	//}
});

// Updates the video-related links based on the one being played
function onVideoSelected(subVideo) {
	var currentTranscript = transcripts[subVideo - 1];
}			

function trim(s)
{
  return s.replace(/^\s+|\s+$/, '');
}









