/* ===============================================================================*/ 
/* Created by: Vladimir Geshanov |  */
/* ===============================================================================*/ 
var arrayData = new Array();
  arrayData[0] = 'Robert Allon|Qualifications for Leadership 1|'
  arrayData[1] = 'Robert Allon|Qualifications for Leadership 2|'
  arrayData[2] = 'Robert Allon|By His Stripes|'
  arrayData[3] = 'Robert Allon|The day of His Vengeance|'
  arrayData[4] = 'Robert Allon|Ten Percent?|'
  arrayData[5] = 'Robert Allon|Bring Me an Offering|'
  arrayData[6] = 'Robert Allon|A Wondering Heart|'
  arrayData[7] = 'Robert Allon|A Reason For Prayer|'
  arrayData[8] = 'Robert Allon|The Sacrifice of Praise|'
  arrayData[9] = 'Robert Allon|The Law of Judgment|'

  arrayData[10] = 'Scholar 1|Test video 1|'
  arrayData[11] = 'Scholar 1|Test video 2|'
  arrayData[12] = 'Scholar 1|Test video 3|'
  arrayData[13] = 'Scholar 1|Test video 4|'
  arrayData[14] = 'Scholar 1|Test video 5|'

  arrayData[15] = 'Scholar 2|Test video 1|'
  arrayData[16] = 'Scholar 2|Test video 2|'
  arrayData[17] = 'Scholar 2|Test video 3|'

  arrayData[18] = 'Scholar 3|Test video 1|'
  arrayData[19] = 'Scholar 3|Test video 2|'
  arrayData[20] = 'Scholar 3|Test video 3|'
  arrayData[21] = 'Scholar 3|Test video 4|'
  arrayData[22] = 'Scholar 3|Test video 5|'
  arrayData[23] = 'Scholar 3|Test video 6|'
  arrayData[24] = 'Scholar 3|Test video 7|'
  arrayData[25] = 'Scholar 3|Test video 8|'


function populateData( name ) {
	select	= window.document.form.SubCategory;
	string	= "";
		// 0 - will display the new options only
		// 1 - will display the first existing option plus the new options
	count	= 0;

		// Clear the old list (above element 0)
	select.options.length = count;

		// Place all matching categories into Options.
	for( i = 0; i < arrayData.length; i++ ) {
		string = arrayData[i].split( "|" );
		if( string[0] == name ) {
			select.options[count++] = new Option( string[1] );
		}
	}
}

/* ===============================================================================*/
/* Created by: Robert Allon */
/* ===============================================================================*/ 
var s = 0
var sScholar

function getVideo (i) { 
   /* Tell me which scholar was selected*/ 
   if (s==0)         {sScholar = 'allon'}
   else if (s==1) {sScholar = 'scholar_1'}
   else if (s==2) {sScholar = 'scholar_2'}
   else                {sScholar = 'scholar_3'}

   i=i+1
   replFlash('scholars/' + sScholar + '/free/' + sScholar + '_' + i + '.swf')

}

/* ===============================================================================*/ 
/* Created by: Jean P. May, Jr.  */
/* ===============================================================================*/ 
function replFlash(vName) {

	fObjPar=document.getElementById('flashObj').parentNode;
	oldObj=document.getElementById('flashObj');	
	newObj=document.getElementById('flashObj').cloneNode(true);
	for(i=0;i<newObj.childNodes.length;i++){
		if (newObj.childNodes[i].name == 'movie')
			newObj.childNodes[i].value = vName; 
		else if (newObj.childNodes[i].id == 'flashEmb') 
			newObj.childNodes[i].src = vName;
	}
	fObjPar.replaceChild(newObj,oldObj); 

}

/* ===============================================================================*/
/* Created by: Robert Allon */
/* ===============================================================================*/ 
function ShortClips(sFileName, sLink)
{ 
   var generator=window.open('','name','height=300,width=400');
  
   generator.document.write("<HTML>");
   generator.document.write("   <HEAD>");
   generator.document.write("      <TITLE>" + sFileName + "</TITLE>");
   generator.document.write("   </HEAD>");
   generator.document.write("   <BODY BGCOLOR='#333300'>");
   generator.document.write("   <CENTER>");
   generator.document.write("   <TABLE ALIGN='center'>");
   generator.document.write("   <TR><TD ALIGN='center'>");
   generator.document.write("   <!-- begin embedded Media file -->");
   generator.document.write("   <TABLE BORDER='0' CELLPADDING='0' ALIGN='center' CLASS='stTwo'>");
   generator.document.write("   <!-- begin video window... -->");
   generator.document.write("   <TR><TD>");
   generator.document.write("   <!-- begin video window -->");
   generator.document.write("   <object id='MediaPlayer' width='288' height='240' classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' standby='Loading Windows Media Player components...' type='application/x-oleobject' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'> ");
   generator.document.write("   <param name='filename' value='" + sLink + "'>");
   generator.document.write("   <param name='Showcontrols' value='True'>");
   generator.document.write("   <param name='autoStart' value='True'>");
   generator.document.write("   <embed type='application/x-mplayer2' src='" + sLink + "' name='MediaPlayer' width='288' height='240'></embed>");
   generator.document.write("   </object>");
   generator.document.write("   <!-- end embedded Media file -->");
   generator.document.write("   </table>");
   generator.document.write("   </TD></TR>");
   generator.document.write("   <TR><TD ALIGN='center'>");
   generator.document.write("   <INPUT TYPE='button' VALUE='Click to close' onClick='window.close()'>");
   generator.document.write("   </TD></TR>");
   generator.document.write("   </TABLE>");
   generator.document.write("   </CENTER>");
   generator.document.write("   </BODY>");
   generator.document.write("</HTML>");
   generator.document.close();
   
}







