var card = {stat: {}, profile: {}, team: {}, news: {}};

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++ Функции для работы с новостями +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

card.news.gopage_searchNews=function(page)
{
	document.sform.page.value=page;
	card.news.searchNews();
}
card.news.searchNews=function()
{
	var act='searchNews';
	var page=document.sform.page.value;
	var cat=document.sform.catnews.value;
	var div=document.getElementById('listnews');
	fint.sendRequest('post', 'ajax_all.php', 'act='+act+'&cat='+cat+'&page='+page, false, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}

card.delNews = function(idd)
{
	if(confirm('Вы уверены что хотите удалить эту новость?'))
	{
		var act='delNews';
		var div=document.getElementById('news');
		fint.sendRequest('post', 'ajax_function.php', 'act='+act+'&id='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [div]);
	}
}
card.addComm = function()
{
	var mess=document.add_comm.mess.value;
	var nw=document.add_comm.nw.value;
	var aut=document.add_comm.aut.value;
	var act='add';
	var div=document.getElementById('comments');
	if(isEmpty(mess))
		alert('Сообщение не должно быть пустым');
	else
		fint.sendRequest('post', 'modules/news/func_comm.php', 'mess="'+mess+'"&act='+act+'&aut='+aut+'&nw='+nw, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.delComm = function(idd)
{
	if(confirm("Подтвердите удаление комментария..."))
	{
		var nw=document.add_comm.nw.value;
		var act='del';
		var div=document.getElementById('comments');
		fint.sendRequest('post', 'modules/news/func_comm.php', 'act='+act+'&id='+idd+'&nw='+nw, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
	}
}
card.editComm = function(idd)
{
	var nw=document.add_comm.nw.value;
	var act='edit';
	var div=document.getElementById('comm_text_'+idd);
	fint.sendRequest('post', 'modules/news/func_comm.php', 'act='+act+'&id='+idd+'&nw='+nw, true, function(npane){npane.innerHTML='<form name="editForm"><textarea name="emess" cols="40" rows="4">'+this.responseText+'</textarea><br><input type=button value="Сохранить" onclick="card.saveComm('+idd+')"></form>'}, null, [div]);
}
card.saveComm = function(idd)
{
	var mess=document.editForm.emess.value;
	//alert(mess)
	var nw=document.add_comm.nw.value;
	var aut=document.add_comm.aut.value;
	var act='saveEdit';
	var div=document.getElementById('comments');
	if(isEmpty(mess))
		alert('Сообщение не должно быть пустым');
	else
		fint.sendRequest('post', 'modules/news/func_comm.php', 'id='+idd+'&mess="'+mess+'"&act='+act+'&aut='+aut+'&nw='+nw, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Конец функций для работы с новостями +++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
card.sendFeadback = function()
{
	var mess=document.feadform.mess.value;
	var name=document.feadform.name.value;
	var section=document.feadform.section.value;
	var act='sendFeadback';
	var div=document.getElementById('answer');
	if(isEmpty(mess))
		alert('Сообщение не должно быть пустым');
	else
		fint.sendRequest('post', 'ajax_function.php', 'mess="'+mess+'"&act='+act+'&section='+section+'&name='+name, true, function(npane){npane.style.display='block'; npane.innerHTML=this.responseText}, null, [div]);
}
card.upd_data = function(idd)
{
	var email=document.form_upd_data.email.value;
	var phone=document.form_upd_data.phone.value;
	var div=document.getElementById('ans');
	if(isEmpty(email) || isEmpty(phone))
		alert('Поля не должны быть пустыми');
	else
		fint.sendRequest('post', 'modules/message/func_mess.php', 'id='+idd+'&email="'+email+'"&phone='+phone, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}

//////////////////////////////////////////////// функции для работы с командами //////////////////////////////////////////////////////////
card.exitTeam=function(idd)
{
	var act='exitTeam';
	var div=document.getElementById('tabteam_'+idd);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd, true, card.exitTeamres, null, [div]);
}
card.sendAddTeam=function(idd)
{
	var act='sendAddTeam';
	var div=document.getElementById('tteam_'+idd);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd, true, card.exitTeamres, null, [div]);
}
card.nosendAddTeam=function(idd)
{
	var act='nosendAddTeam';
	var div=document.getElementById('nost_'+idd);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd, true, card.exitTeamres, null, [div]);
}
card.exitTeamres=function(npane)
{
	npane.innerHTML=this.responseText;
	var tc=document.getElementById('showcolteams').innerHTML;
	col=tc.replace(/[^0-9]+/g, '');
	col=col-1;
	if(col>0)
		document.getElementById('showcolteams').innerHTML='Вы состоите в '+col+' командах';
	else
		document.getElementById('showcolteams').innerHTML='';
}
card.okInvat=function(idd)
{
	var act='okInvat';
	var div=document.getElementById('myteams');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd, true, card.Invatres, null, [div]);
}
card.noInvat=function(idd)
{
	var act='noInvat';
	var div=document.getElementById('tabinvteam_'+idd);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd, true, card.Invatres, null, [div]);
}
card.Invatres=function(npane)
{
	npane.innerHTML=this.responseText;
	var tc=document.getElementById('count_team').innerHTML;
	col=tc.replace(/[^0-9]+/g, '');
	col=col-1;
	if(col>0)
		document.getElementById('count_team').innerHTML='('+col+')';
	else
		document.getElementById('count_team').innerHTML='';
}
card.delCardTeam=function(cid, tid)
{
	var act='delCardTeam';
	var div=document.getElementById('trpl_'+cid);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cid='+cid+'&tid='+tid, true, card.showDelCardTeam, null, [div]);
}
card.showDelCardTeam=function(npane)
{
	npane.innerHTML=this.responseText;
	var tc=document.getElementById('col_pl').innerHTML;
	col=tc.replace(/[^0-9]+/g, '');
	col=col-1;
	if(col>0)
		document.getElementById('col_pl').innerHTML='В команде находятся '+col+' игроков.';
}
card.addInvatTeam=function(cid, tid)
{
	var act='addInvatTeam';
	var div=document.getElementById('trpl_'+cid);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cid='+cid+'&tid='+tid, true, card.showResInvatTeam, null, [div]);
}
card.delInvatTeam=function(cid, tid)
{
	var act='delInvatTeam';
	var div=document.getElementById('trpl_'+cid);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cid='+cid+'&tid='+tid, true, card.showResInvatTeam, null, [div]);
}
card.delInvatInTeam=function(cid, tid)
{
	var act='delInvatInTeam';
	var div=document.getElementById('trpl_'+cid);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cid='+cid+'&tid='+tid, true, card.showResInvatTeam3, null, [div]);
}
card.sendAddInvTeam=function(cid, tid)
{
	var act='sendAddInvTeam';
	var div=document.getElementById('trpl_'+cid);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cid='+cid+'&tid='+tid, true, card.showResInvatTeam2, null, [div]);
}
card.team.addPl=function(cid, tid)
{
	var act='addPl';
	var div=document.getElementById('trpl_'+cid);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cid='+cid+'&tid='+tid, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.showResInvatTeam=function(npane)
{
	npane.innerHTML=this.responseText;
	var tc=document.getElementById('col_pl').innerHTML;
	col=tc.replace(/[^0-9]+/g, '');
	col=col-1;
	document.getElementById('col_pl').innerHTML='Заявок на вступление в команду: '+col+'.';
}
card.showResInvatTeam2=function(npane)
{
	npane.innerHTML=this.responseText;
	var tc=document.getElementById('col_pl').innerHTML;
	col=tc.replace(/[^0-9]+/g, '');
	col=col-(-1);
	document.getElementById('col_pl').innerHTML='Приглашений отослано: '+col+'.';
}
card.showResInvatTeam3=function(npane)
{
	npane.innerHTML=this.responseText;
	var tc=document.getElementById('col_pl').innerHTML;
	col=tc.replace(/[^0-9]+/g, '');
	col=col-1;
	document.getElementById('col_pl').innerHTML='Приглашений отослано: '+col+'.';
}
card.saveinfTeam=function(idd)
{
	var name=document.upd_team.name.value;
	var date=document.upd_team.date.value;
	var form1=document.upd_team.form1.value;
	var form2=document.upd_team.form2.value;
	var cap=document.upd_team.cap.value;
	var vs=document.upd_team.vs.value;
	var idnovoplat=document.upd_team.idnovoplat.value;
	var act='saveinfTeam';
	var div=document.getElementById('cont_team');
	if(isEmpty(name) || isEmpty(cap))
		alert('Поля название, капитан и вид спорта не должны быть пустыми');
	else
		fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd+'&name="'+name+'"&date='+date+'"&form1='+form1+'"&form2='+form2+'"&cap='+cap+'"&vs='+vs+'"&idnovoplat='+idnovoplat, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.searchCard=function(s, id)
{
	var act='searchCard';
	var div=document.getElementById('res-ser');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&s='+s+'&id='+id, false, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.searchPeople=function(s)
{
	var act='searchPeople';
	var page=document.sform.page.value;
	var div=document.getElementById('result');
	if(s!='')
		fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&s='+s+'&page='+page, false, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.gopage_searchPeople=function(page)
{
	document.sform.page.value=page;
	s=document.sform.sinput.value;
	card.searchPeople(s);
}
card.searchTeam=function(s)
{
	var act='searchTeam';
	var page=document.sform.page.value;
	var div=document.getElementById('result');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&s='+s+'&page='+page, false, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.gopage_searchTeam=function(page)
{
	document.sform.page.value=page;
	s=document.sform.sinput.value;
	card.searchTeam(s);
}
card.searchRefere=function(s)
{
	var act='searchRefere';
	var page=document.sform.page.value;
	var div=document.getElementById('result');
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&s='+s+'&page='+page, false, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
card.gopage_searchRefere=function(page)
{
	document.sform.page.value=page;
	s=document.sform.sinput.value;
	card.searchRefere(s);
}

card.select_sorg=function(elm, idd)
{
	var sorg=elm.value;
	var act='selectSorg';
	var span=document.getElementById('sel_sorev2');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&sorg='+sorg+'&id='+idd, true, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}


card.sendZayvka=function(idd)
{
	var act='sendZayvka';
	var sorg=document.select_ms.sorg.value;
	var sorev=document.select_ms.sorev.value;
	var phone1=document.select_ms.phone1.value;
	var fio1=document.select_ms.fio1.value;
	var fio2=document.select_ms.fio2.value;
	var phone2=document.select_ms.phone2.value;
	var pla2=new Array();
	if(sorg==0)
	{
		alert('Спортивная организация не выбрана!');
		return false;
	}
	if(sorev==0)
	{
		alert('Соревнование не выбрано!');
		return false;
	}
	if(phone1=='')
	{
		alert('Не указан номер телефона капитана!');
		return false;
	}
	if(phone2=='')
	{
		alert('Не указан номер телефона зам. капитана!');
		return false;
	}
	if(fio1=='')
	{
		alert('ФИО капитана не указаны!');
		return false;
	}
	if(fio2=='')
	{
		alert('ФИО зам. капитана не указаны!');
		return false;
	}
	if(phone1.length!=10 || !(/^[0-9]+$/.test(phone1)))
	{
		alert('Номер телефона должен состоять из 10 цифр');
		document.select_ms.phone1.value='';
		return false;
	}
	if(phone2.length!=10 || !(/^[0-9]+$/.test(phone2)))
	{
		alert('Номер телефона должен состоять из 10 цифр');
		document.select_ms.phone2.value='';
		return false;
	}
	if(phone1==phone2)
	{
		alert('Номера телефонов не должны быть одинаковыми!');
		document.select_ms.phone2.value='';
		return false;
	}
	var pla=document.sendZayvkaform.pl;
	k=0;
	for (var i=0; i < pla.length; i++)
		if (pla[i].checked)
		{
			pla2[k]=pla[i].value;
			k++;
		}
	var div=document.getElementById('res-send');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&id='+idd+'&sorg='+sorg+'&sorev='+sorev+'&pl='+pla2+'&count='+pla2.length+'&phone1='+phone1+'&phone2='+phone2+'&fio1='+fio1+'&fio2='+fio2, true, function(npane){npane.innerHTML=this.responseText}, null, [div]);
}
////////////////////////////////////// Конец функций для работы с командами ////////////////////////////////////////////////////////////////
card.stat.selectSorg=function(elm)
{
	var sorg=elm.value;
	var act='StatselectSorg';
	var span=document.getElementById('ms');
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorg='+sorg, false, card.stat.obSelectSorg, null, [span]);
}

card.stat.obSelectSorg=function()
{ 
	var elem=document.getElementById('ms');
	var elem2=document.getElementById('sorev');
	elem2.innerHTML='<option value=0>-Не выбран-</option>';
	document.getElementById('show_stat').innerHTML='';
	if(this.responseText==false)
	{
		elem.innerHTML='<option value=0>-Не выбрано-</option>';
	}
	else
	{
		elem.innerHTML='<option value=0>Не выбрано</option>';
		var data = eval(this.responseText)
		for(i=0; i<data.length; i++)
		{
			elem.innerHTML+='<option value='+data[i].id+'>'+data[i].name+'</option>';
		}
	}
}
card.stat.selectMs=function(elm)
{
	var ms=elm.value;
	var act='StatselectMs';
	var span=document.getElementById('sorev');
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&ms='+ms, false, card.stat.obSelectMs, null, [span]);
}

card.stat.obSelectMs=function()
{ 
	var elem=document.getElementById('sorev');
	document.getElementById('show_stat').innerHTML='';
	if(this.responseText==false)
	{
		elem.innerHTML='<option value=0>-Не выбран-</option>';
	}
	else
	{
		elem.innerHTML='<option value=0>Не выбран</option>';
		var data = eval(this.responseText)
		for(i=0; i<data.length; i++)
		{
			elem.innerHTML+='<option value='+data[i].id+'>'+data[i].name+'</option>';
		}
	}
}
card.stat.selectSorev=function(elm)
{
	var sorev=elm.value;
	var act='StatselectSorev';
	var span=document.getElementById('show_stat');
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+sorev, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.showStat=function(idd)
{
	var act='StatShowStat';
	var span=document.getElementById('show_stat'+idd);
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.showCalen=function(idd)
{
	var act='StatShowCalen';
	var span=document.getElementById('show_stat'+idd);
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.showTable=function(idd)
{
	var act='StatselectSorev';
	var span=document.getElementById('show_stat'+idd);
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.StatShowBomb=function(idd)
{
	var act='StatShowBomb';
	var span=document.getElementById('table_stat_show'+idd);
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.StatShowNar=function(idd)
{
	var act='StatShowNar';
	var span=document.getElementById('table_stat_show'+idd);
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.StatShowAll=function(idd)
{
	var act='StatShowAll';
	var span=document.getElementById('table_stat_show'+idd);
	fint.sendRequest('post', 'ajax_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_selectSorev=function(elm)
{
	var sorev=elm.value;
	var act='StatselectSorev';
	var span=document.getElementById('show_stat');
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+sorev, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_showStat=function(idd)
{
	var act='StatShowStat';
	var span=document.getElementById('show_stat'+idd);
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_showCalen=function(idd)
{
	var act='StatShowCalen';
	var span=document.getElementById('show_stat'+idd);
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_showTable=function(idd)
{
	var act='StatselectSorev';
	var span=document.getElementById('show_stat'+idd);
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_StatShowBomb=function(idd)
{
	var act='StatShowBomb';
	var span=document.getElementById('table_stat_show'+idd);
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_StatShowNar=function(idd)
{
	var act='StatShowNar';
	var span=document.getElementById('table_stat_show'+idd);
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.stat.demo_StatShowAll=function(idd)
{
	var act='StatShowAll';
	var span=document.getElementById('table_stat_show'+idd);
	fint.sendRequest('post', 'ajax_demo_stat_function.php', 'act='+act+'&sorev='+idd, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
////////////////////////////////////////// ФУНКЦИИ ДЛЯ РАБОТЫ С ПРОФИЛЕМ ////////////////////////////////////////////////////////////////////
card.profile.selectFormat=function(format, idpl)
{
	var act='selectFormat';
	var span=document.getElementById('res-stat');
	fint.sendRequest('post', 'ajax_profile_function.php', 'act='+act+'&format='+format+'&idpl='+idpl, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.profile.saveSport=function()
{
	vs=document.reg_card.view_sport.value;
	sorg=document.reg_card.sorg.value;
	var act='saveSport';
	var span=document.getElementById('res');
	fint.sendRequest('post', 'ajax_profile_function.php', 'act='+act+'&vs='+vs+'&sorg='+sorg, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.profile.saveInter=function()
{
	vk=document.reg_card.vkontakte.value;
	odnok=document.reg_card.odnok.value;
	myworld=document.reg_card.myworld.value;
	facebook=document.reg_card.facebook.value;
	spbfootball=document.reg_card.spbfootball.value;
	icq=document.reg_card.icq.value;
	var act='saveInter';
	var span=document.getElementById('res');
	fint.sendRequest('post', 'ajax_profile_function.php', 'act='+act+'&vk='+vk+'&odnok='+odnok+'&myworld='+myworld+'&facebook='+facebook+'&spbfootball='+spbfootball+'&icq='+icq, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.profile.savePas=function()
{
	address=document.reg_card.address.value;
	desc=document.reg_card.poutdesc.value;
	year=document.reg_card.year.value;
	day=document.reg_card.day.value;
	mon=document.reg_card.mon.value;
	rfv=document.reg_card.rf;
	for (var i=0; i < rfv.length; i++)
		if (rfv[i].checked)
		{
			rf=rfv[i].value;
		}
	if(rf==1)
	{
		pser=document.reg_card.pseries.value;
		pnum=document.reg_card.pnumber.value;
		str='&pseries='+pser+'&pnumber='+pnum;
	}
	else
		str='';
	var act='savePas';
	var span=document.getElementById('res');
	fint.sendRequest('post', 'ajax_profile_function.php', 'act='+act+'&address='+address+'&year='+year+'&mon='+mon+'&day='+day+'&pdesc='+desc+'&rf='+rf+str, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.profile.generateCard=function()
{
	var act='generateCard';
	var span=document.getElementById('answGen');
	fint.sendRequest('post', 'ajax_profile_function.php', 'act='+act, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.team.selectFormat=function(format, idtm)
{
	var act='selectFormat';
	var span=document.getElementById('res-stat');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&format='+format+'&idtm='+idtm, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.team.addNewUser=function(idtm)
{
	var act='addNewUser';
	var span=document.getElementById('cont_team');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&idt='+idtm, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.team.editNewUser=function(idtm, idpl)
{
	var act='editNewUser';
	var span=document.getElementById('cont_team');
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&idt='+idtm+'&idpl='+idpl, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
card.team.addNewUserSave=function()
{
	var error='';
	var lastname=document.addform.lastname.value;
	if(lastname == null || lastname.length == 0 || !(/^[А-Яа-я]+$/.test(lastname)))
		error+='Фамилия введена не правильно!\n';
	var firstname=document.addform.firstname.value;
	if(firstname == null || firstname.length == 0 || !(/^[А-Яа-я]+$/.test(firstname)))
		error+='Имя введено не правильно!\n';
	var ot=document.addform.ot.value;
	if(ot == null || ot.length == 0 || !(/^[А-Яа-я]+$/.test(ot)))
		error+='Отчество введено не правильно!\n';
	var country=document.addform.country.value;
	if(country == 0)
		error+='Страна не выбрана!\n';
	var city=document.addform.city.value;
	if(city == 0)
		error+='Город не выбран!\n';
	if(error!='')
		alert('За время регистрации произошли след. ошибки\n'+error);
	else
	{
		document.addform.k.value=3;
		document.addform.submit();
	}
}
card.team.editNewUserSave=function()
{
	var error='';
	var lastname=document.addform.lastname.value;
	if(lastname == null || lastname.length == 0 || !(/^[А-Яа-я]+$/.test(lastname)))
		error+='Фамилия введена не правильно!\n';
	var firstname=document.addform.firstname.value;
	if(firstname == null || firstname.length == 0 || !(/^[А-Яа-я]+$/.test(firstname)))
		error+='Имя введено не правильно!\n';
	var ot=document.addform.ot.value;
	if(ot == null || ot.length == 0 || !(/^[А-Яа-я]+$/.test(ot)))
		error+='Отчество введено не правильно!\n';
	var country=document.addform.country.value;
	if(country == 0)
		error+='Страна не выбрана!\n';
	var city=document.addform.city.value;
	if(city == 0)
		error+='Город не выбран!\n';
	if(error!='')
		alert('За время регистрации произошли след. ошибки\n'+error);
	else
	{
		document.addform.k.value=2;
		document.addform.submit();
	}
}
card.team.changeCat=function(cat, team, user)
{
	var act='changeCat';
	var span=document.getElementById('pl'+user);
	fint.sendRequest('post', 'ajax_team_function.php', 'act='+act+'&cat='+cat+'&team='+team+'&user='+user, false, function(npane){npane.innerHTML=this.responseText}, null, [span]);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////