function tt() {
    $("#teacher").text("");
    $("#teacherFIO").text("");
    teachid = $("#teach option:selected").val();
    param = '?teachid'+teachid;
    $("#teacher").load("/js/ajax_teacher_by_subj.php"+param);
}

function getTeachersBySection() {
    $("#teacher").text("");
    $("#teacherFIO").text("");
    $("#subj").load("/js/ajax_teacher_by_subj.php?secid="+$('#pr').attr("value"));
    $("#teacher").text("");
    $("#teacher").load("/js/ajax_teacher_by_subj.php?teacherbyid="+$('#pr').attr("value"));
}

function loadcont(id) {
    $("#teacher").text("");
    $("#teacherFIO").text("");
param = 'showlector=' + id;

var value = (function () {
    var val = null;
    $.ajax({
        'async': false,
        'global': false,
        'data': param,
        'url': '/js/ajax_teacher_by_subj.php',
        'success': function (data) { val = data;} 
        });

        $("#teacherFIO").replaceWith('<table id="teacherFIO" cellspacing="0" cellpadding="0" border="0"><tbody>' + val + '</tbody></table>');
        
    return val;})();

}    


function open_full(surname)
{
  window.open('lecturers/'+surname+'.html', 'newWin', 'Toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Scrollbar=0, Resizable=yes, Copyhistory=1, Width=650, Height=530, top=50, left=100');
}

function tab1_sel(f)
{
	f.className = "tab1_sel";
}

function tab1_desel(f)
{
	f.className = "tab1";
}

function tab2_sel(f)
{
	f.className = "tab2_sel";
}

function tab2_desel(f)
{
	f.className = "tab2";
}

function tab_click(id)
{
	window.open('mba_modules_view.php?id='+id,'','width=600px, height=350px, scrollbars=1');
}

function tab_mba(id)
{
	window.open('mba.php?id='+id,'','width=600px, height=600px, scrollbars=1');
}

function tab_ma(id)
{
	window.open('ma.php?id='+id,'','width=600px, height=600px, scrollbars=1');
}

function change_employee_fields()
{
/*                                                                  // ошибки в админке
	if (form1.employee_section.value==1)
	{
		document.getElementById('lecture').style.display = 'block';
		document.getElementById('administration').style.display = 'none';
	}
	else
	{
		document.getElementById('lecture').style.display = 'none';
		document.getElementById('administration').style.display = 'block';
	}
*/
}

function show_hide(elem)
{
	if (document.getElementById(elem).style.display=='none')
	{
		document.getElementById(elem).style.display='block';
	}
	else
	{
		document.getElementById(elem).style.display='none';
	}
}

function fromcolor(elem)
{
	document.getElementById(elem).style.background="#FFFFFF";
}

function tocolor(elem)
{
	document.getElementById(elem).style.background="#ffffe6";
}

function graytocolor_blocks_images(elem1,elem2)
{
	document.getElementById("bg_elem"+elem1).style.filter="";
	document.getElementById("bg_elem"+elem2).style.filter="";
}

function colortogray_blocks_images()
{
	document.getElementById("bg_elem1").style.filter="gray";
	document.getElementById("bg_elem2").style.filter="gray";
	document.getElementById("bg_elem3").style.filter="gray";
	document.getElementById("bg_elem4").style.filter="gray";
}

function show_blocks_images(elem1, elem2)
{
	graytocolor_blocks_images(elem1,elem2);
}

function hide_blocks_images()
{
	colortogray_blocks_images();
}

function shwbnt(id) {
    cl = $('#'+id).hasClass("hd");
    if (cl == false) {
        $('#'+id).addClass("hd");    
    } else {
        $('#'+id).removeClass("hd");    
    }

}