function info_sotr(i,idsotr,idmenu,type) {
	$("#info_sotr").html('');
	$("#info_sotr").html('Идет загрузка данных...');
	if (i==1) { $('.menu_sotr2').removeClass('menu_sotr2'); $("#about").addClass('menu_sotr2'); }
	if (i==2) { $('.menu_sotr2').removeClass('menu_sotr2'); $("#about").addClass('menu_sotr1');$("#edu").addClass('menu_sotr2'); }
	if (i==3) { $('.menu_sotr2').removeClass('menu_sotr2'); $("#about").addClass('menu_sotr1');$("#nir").addClass('menu_sotr2'); }
	if (i==4) { $('.menu_sotr2').removeClass('menu_sotr2'); $("#about").addClass('menu_sotr1');$("#discipline").addClass('menu_sotr2'); }
	if (i==5) { $('.menu_sotr2').removeClass('menu_sotr2'); $("#about").addClass('menu_sotr1');$("#grant").addClass('menu_sotr2'); }
	if (i==6) { $('.menu_sotr2').removeClass('menu_sotr2'); $("#about").addClass('menu_sotr1');$("#public").addClass('menu_sotr2'); }
	$.ajax({
		type: "GET",
		url: "/ajax/info_sotr.php",
		data: "i="+i+"&idsotr="+idsotr+"&idmenu="+idmenu+"&type="+type,
		success: function(html) {
			$("#info_sotr").html('');
			$("#info_sotr").html(html);
			$("#info_sotr").show();
		}
	});
}

function reiting() {
	$("#reiting").show();
	var idmenu=$("#faculty").val();
	var spec=$("#idspec").val();

	var url=window.location.pathname;
	if (url=='/zachislenie_budget/') {type="1";}
	else if (url=='/zachislenie_vnebudget/') {type="2";}
	else if (url=='/zachislenie_vnebudget_spo/') {type="3";}

	if (type==1) {
		$.ajax({
			type:"GET",
			url: "/ajax/zachislenie_budget.php",
			data:"idmenu="+idmenu+"&idspec="+spec,
			success: function(html) {
				$("#reiting").html('');
				$("#reiting").html(html);
				$("#reiting").show();
			}
		});
	}
	else if (type==2) {
		$.ajax({
			type:"GET",
			url: "/ajax/zachislenie_vnebudget.php",
			data:"idmenu="+idmenu+"&idspec="+spec,
			success: function(html) {
				$("#reiting").html('');
				$("#reiting").html(html);
				$("#reiting").show();
			}
		});
	}
	else if (type==3) {
		$.ajax({
			type:"GET",
			url: "/ajax/zachislenie_vnebudget_spo.php",
			data:"idmenu="+idmenu+"&idspec="+spec,
			success: function(html) {
				$("#reiting").html('');
				$("#reiting").html(html);
				$("#reiting").show();
			}
		});
	}
}
/*
function tipobrazov() {
	$("#reiting").hide();
	$.ajax({
		type:"GET",
		url: "/ajax/tipobrazov.php",
		success: function(html) {
			$("#tipobrazov").html('');
			$("#tipobrazov").html(html);
			$("#tipobrazov").show();
		}
	});
}
*/

function spec() {
	$("#reiting").hide();
	$("#idtipobrazov").show();
	$("#spec").show();

	var idmenu=$("#faculty").val();
	$.ajax({
		type:"GET",
		url: "/ajax/spec.php",
		data:"idmenu="+idmenu,
		success: function(html) {
			$("#spec").html('');
			$("#spec").html(html);
			$("#spec").show();
		}
	});
}

function dr(type) {
	$.ajax({
		type: "GET",
		url: "/ajax/dr.php",
		data: "type="+type,
		success: function(html) {
			$("#denrozhd").html('');
			$("#denrozhd").html(html);
			$("#denrozhd").show();
		}
	});
}

function shedule() {
	$("#shedule").html("Идет загрузка...");
	$("#shedule").show();
	var idgruppa=$("#idgruppa").val();
	$.ajax({
		type:"POST",
		url: "/ajax/shedule.php",
		data:"idgruppa="+idgruppa,
		success: function(html) {
			$("#shedule").html('');
			$("#shedule").html(html);
			$("#shedule").show();
		}
	});
}

function faculty() {
	$("#shedule").html('');
	$("#gruppa").show();
	var idmenu=$("#idfaculty").val();
	$.ajax({
		type:"POST",
		url: "/ajax/faculty.php",
		data:"idmenu="+idmenu,
		success: function(html) {
			$("#gruppa").html('');
			$("#gruppa").html(html);
			$("#gruppa").show();
		}
	});
}

function closefon() {
	$("#fon").hide();
	$("#idfoto").hide();
}

function idfoto(idimg,idgallery) {
	$("#fotoalbum td").css({"background":"#ffffff"});
	$("#idfoto"+idimg).css({"background":"#d4d4d4"});
	$.ajax({
		type:"GET",
		url:"/ajax/idfoto.php",
		data:"idimg="+idimg+"&idgallery="+idgallery,
		success: function(html) {
			$("#idfoto").html('');
			$("#idfoto").html(html);
			$("#idfoto").show();
		}
	});
}

function fotoalbum(idmenu,idgallery) {
	$("#foto").html('');
	$("#foto").html("Идет загрузка...");
	$("#foto").show();
	$('#multi-derevo a').css("color","#363636");
	$("#"+idgallery).css("color","#213ff2");
	$.ajax({
		type: "GET",
		url: "/ajax/fotoalbum.php",
		data: "idmenu="+idmenu+"&idgallery="+idgallery,
		success: function(html) {
			$("#foto").html('');
			$("#foto").html(html);
			$("#foto").show();
		}
	});	
}

function catalog(idmenu,idcatalog) {
	$("#file").append("Идет загрузка...");
	$("#navigation1 a").css({"color":"#363636"});
	$("#"+idcatalog).css({"color":"#213ff2"});
	$.ajax({
		type: "GET",
		url: "/ajax/catalog.php",
		data: "idmenu="+idmenu+"&idcatalog="+idcatalog,
		success: function(html) {
			$("#file").html('');
			$("#file").html(html);
			$("#file").show();
		}
	});	
}

$(document).ready(function () {

$("table td #td1").hover(function() {$("table tr td #td1").css({"background":"#008aff"});}, function() {$("table tr td #td1").css("background-image","url(/images/fonmenu.gif)");});
$("table td #td2").hover(function() {$("table tr td #td2").css({"background":"#008aff"});}, function() {$("table tr td #td2").css("background-image","url(/images/fonmenu.gif)");});
$("table td #td3").hover(function() {$("table tr td #td3").css({"background":"#008aff"});}, function() {$("table tr td #td3").css("background-image","url(/images/fonmenu.gif)");});
$("table td #td4").hover(function() {$("table tr td #td4").css({"background":"#008aff"});}, function() {$("table tr td #td4").css("background-image","url(/images/fonmenu.gif)");});
$("table td #td5").hover(function() {$("table tr td #td5").css({"background":"#008aff"});}, function() {$("table tr td #td5").css("background-image","url(/images/fonmenu.gif)");});

	$("#navigation1").treeview({
		collapsed: true,
		unique: true,
		persist: "location"
	});

});


