//	Check form element functions

function InsertFlashObj(name, table, td, element, maxH, code) {
	this.obj_name     = name;
	this.table_name   = table;
	this.td_name      = td;
	this.maxHeight    = maxH;
	this.HTMLcode     = code;
	this.element_name = element;
	this.counter      = 0;
	
	this.grow = function() {
		
		var table_row = document.getElementById(this.td_name);
		var table_table = document.getElementById(this.table_name);
		
		var height = this.maxHeight;	
		//var counter = parseInt(document.getElementById('counter').value);
		
		if( this.counter < this.maxHeight ) {				
			this.counter = this.counter + 20;
			//document.getElementById('counter').value=counter;
			table_row.height   = this.counter;
			table_table.height = this.counter;
			
			var functionStr = this.obj_name + '.grow()';			
			var timeout = window.setTimeout(functionStr, 40);
			
		}else{
			document.getElementById(this.element_name).innerHTML = this.HTMLcode;
		}
	}
	
	this.shrink = function() {
		
		var table_row = document.getElementById(this.td_name);
		var table_table = document.getElementById(this.table_name);
		
		var finalHeight = 0;	
		//var counter = parseInt(document.getElementById('counter').value);		
		
		document.getElementById(this.element_name).innerHTML = '';
		if( this.counter > finalHeight ){
			this.counter = this.counter - 20;
			//document.getElementById('counter').value=counter;
			table_row.height   = this.counter;
			table_table.height = this.counter;
			
			var functionStr = this.obj_name + '.shrink()';			
			var timeout = window.setTimeout(functionStr, 40);
		}		
	}
}


function playSmallLecture(){
	
	var table_name = 'lecture_small_table';
	var data_name  = 'lecture_small_data';
	var div_name   = 'lectures_small';
	var height     = 210;
	var htmlCode   = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' "
	+ "codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'"
	+ "width='300' height='200' id='talk_small' align='middle'>"
	+ "<param name='allowScriptAccess' value='sameDomain' />"
	+ "<param name='movie' value='movies/talk_small.swf' /><param name='quality' value='high' />"
	+ "<param name='bgcolor' value='#ffffff' /><embed src='movies/talk_small.swf' quality='high' "
	+ "bgcolor='#ffffff' width='300' height='200' name='talk_small' align='middle' "
	+ "allowScriptAccess='sameDomain' type='application/x-shockwave-flash' "
	+ "pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
	
	smallLectureObj = new InsertFlashObj('smallLectureObj', table_name, data_name, div_name, height, htmlCode);
	var timeout = window.setTimeout("smallLectureObj.grow()",50);	
}

function closeSmallLecture(){
	var timeout = window.setTimeout("smallLectureObj.shrink()",50);	
}

function playLargeLecture(){
	
	var table_name = 'lecture_large_table';
	var data_name  = 'lecture_large_data';
	var div_name   = 'lectures_large';
	var height     = 210;
	var htmlCode   = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' "
	+ "codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'"
	+ "width='300' height='200' id='talk_large' align='middle'>"
	+ "<param name='allowScriptAccess' value='sameDomain' />"
	+ "<param name='movie' value='movies/talk_large.swf' /><param name='quality' value='high' />"
	+ "<param name='bgcolor' value='#ffffff' /><embed src='movies/talk_large.swf' quality='high' "
	+ "bgcolor='#ffffff' width='300' height='200' name='talk_small' align='middle' "
	+ "allowScriptAccess='sameDomain' type='application/x-shockwave-flash' "
	+ "pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
	
	largeLectureObj = new InsertFlashObj('largeLectureObj', table_name, data_name, div_name, height, htmlCode);
	var timeout = window.setTimeout("largeLectureObj.grow()",50);	
}

function closeLargeLecture(){
	var timeout = window.setTimeout("largeLectureObj.shrink()",50);	
}