<!--

/**
 *
 * Copyright (C) 1999-2006 Pictron Inc.
 * All Rights Reserved
 * This Software Contains Pictron Inc. Confidential, Proprietary, and Trade Secret.
 *
 */
 
var SkipStepsNS = 4;
var isWin = false;
var isIE = false;
if ((navigator.platform).indexOf("Win")>=0) isWin = true;
if ((navigator.appVersion).indexOf("MSIE")>=0) isIE = true;

function OpenLink(link)
{
	document.location.href=link;
}

function OpenHelpWindow()
{
	var newWindow;
	newWindow = window.open("Help.asp","HelpMenu",
	"status=0,height=267,width=346,scrollbars=0,resizable=0,toolbar=0");
	newWindow.focus();
}

function ChangeSetting(SettingMode)
{
	if (isWin && isIE)
	{
		if(SettingMode == 1)
		{
			document.location.href = "VideoPlayer.asp?Audio=ENGLISH&VideoID=" + document.all.VideoID.value;
		}
		else if(SettingMode == 2)
		{
			document.location.href = "VideoPlayer.asp?Audio=SPANISH&VideoID=" + document.all.VideoID.value;
		}
		else if(SettingMode == 3)
		{
			DaURL = "OpenTranscript.asp?VideoID=" + document.all.VideoID.value + "&Format=PDF&Player=VIDEO"
			window.self.name = 'LACounty Setting';
			ItsTheWindow = window.open(DaURL, "Transcript");
			ItsTheWindow.focus();
		}
		else if(SettingMode == 4)
		{
			DaURL = "OpenTranscript.asp?VideoID=" + document.all.VideoID.value + "&Format=MSWORD&Player=VIDEO"
			window.self.name = 'LACounty Setting';
			ItsTheWindow = window.open(DaURL, "Transcript");
			ItsTheWindow.focus();
		}
		else if(SettingMode == 5)
		{
			document.location.href = "AudioPlayer.asp?Audio=ENGLISH&VideoID=" + document.all.VideoID.value;
		}
		else if (SettingMode == 6)
		{
			document.location.href = "AudioPlayer.asp?Audio=SPANISH&VideoID=" + document.all.VideoID.value;
		}
		else if(SettingMode == 7)
		{
			DaURL = "OpenTranscript.asp?VideoID=" + document.all.VideoID.value + "&Format=PDF&Player=AUDIO"
			window.self.name = 'LACounty Setting';
			ItsTheWindow = window.open(DaURL, "Transcript");
			ItsTheWindow.focus();
		}
		else if(SettingMode == 8)
		{
			DaURL = "OpenTranscript.asp?VideoID=" + document.all.VideoID.value + "&Format=MSWORD&Player=AUDIO"
			window.self.name = 'LACounty Setting';
			ItsTheWindow = window.open(DaURL, "Transcript");
			ItsTheWindow.focus();
		}
	}
	else
	{
		var daURL;
		if(SettingMode == 1)
		{
			daURL = "VideoPlayer_NS.asp?Audio=ENGLISH";
			document.location.href = daURL;
		}
		else if(SettingMode == 2)
		{
			daURL = "VideoPlayer_NS.asp?Audio=SPANISH";
			document.location.href = daURL;
		}
		else if(SettingMode == 5)
		{
			daURL = "AudioPlayer_NS.asp?Audio=ENGLISH";
			document.location.href = daURL;
		}
		else if (SettingMode == 6)
		{
			daURL = "AudioPlayer_NS.asp?Audio=SPANISH";
			document.location.href = daURL;
		}
	}
	
}

function ChangeMeetingDate()
{
	document.frmMeetingDate.submit();
	
}

function PlayAudioSegment()
{
	if(document.frmClipID.VideoID.value != "")
	{
		document.frmClipID.submit();
	}
}

function PlayVideoSegment()
{
	if(document.frmClipID.VideoID.value != "")
	{
		document.frmClipID.submit();
	}
}

function GotoStartNS()
{	
	if (document.frmTranscript)
	{
		var nLine = document.frmTranscript.Transcript.length;
		if (nLine > 0)
		{
			 document.frmTranscript.Transcript.selectedIndex = 0;
		}
	
	}
}

function GotoPreviousPageNS()
{
	if (document.frmTranscript)
	{
	
		var nLine = document.frmTranscript.Transcript.length;
		if (nLine > 0)
		{
			var currentIndex = document.frmTranscript.Transcript.selectedIndex;
			var selectLine = currentIndex - SkipStepsNS;	
			if (selectLine < 0)
				selectLine = 0;
				
			document.frmTranscript.Transcript.selectedIndex = selectLine;
		}
	}
}

function GotoNextPageNS()
{	
	if (document.frmTranscript)
	{
		var nLine = document.frmTranscript.Transcript.length;
		if (nLine > 0)
		{
			var currentIndex = document.frmTranscript.Transcript.selectedIndex;
			var selectLine = currentIndex + SkipStepsNS;	
			document.frmTranscript.Transcript.selectedIndex = nLine-1
			if( selectLine < nLine-1)
				document.frmTranscript.Transcript.selectedIndex = selectLine;
		}
	}
}

function SearchTranscriptNS(SearchType)
{
	var SearchString = document.frmSearchTranscript.SearchValue.value;
	if((document.frmTranscript) && (SearchString != ""))
	{
		SearchString = SearchString.toUpperCase();
		if(SearchString != LastSearchString)
		{
			NextSearchLine = 0;
			LastSearchString = SearchString;
		}
		for (i=NextSearchLine; i< document.frmTranscript.Transcript.options.length; i++)
		{
			TranscriptLine =  document.frmTranscript.Transcript.options[i].text;
			TranscriptLine = TranscriptLine.toUpperCase();
			if(TranscriptLine.indexOf(SearchString) >= 0 )
			{
				var nLine = document.frmTranscript.Transcript.length;
				document.frmTranscript.Transcript.selectedIndex = nLine - 1;
				document.frmTranscript.Transcript.selectedIndex = i;
				NextSearchLine = i + 1;
				return;
			}	
		}
		alert("No results");
	}	
}

function SearchResultTranscript(frmName, startFrom)
{
	if((frmName.SearchValue) && (frmName.SearchValue.value != ""))
	{	SearchString = frmName.SearchValue.value;
		SearchString = SearchString.toUpperCase();
		for (i=startFrom; i< frmName.Transcript.options.length; i++)
		{
			TranscriptLine =  frmName.Transcript.options[i].text;
			TranscriptLine = TranscriptLine.toUpperCase();
			if(TranscriptLine.indexOf(SearchString) >= 0 )
			{
				frmName.Transcript.selectedIndex = i;
				return;
			}
		}	
	}
}
function SubmitResultForm(frmName)
{
	if(isWin && isIE)
	{
		frmName.submit();
	}
	else
	{
		frmName.action = "VideoPlayer_NS.asp"
		frmName.submit();
	}
}
//-->