function sendComment(ID)
{

	
	name = document.getElementById('comName').value;
	text = document.getElementById('comText').value;
	num = document.getElementById('comNumH').value;
	city = document.getElementById('comCity').value;
	mail = document.getElementById('comMail').value;
	comNum = document.getElementById('comNUM').value;

	if (comNum != '')
	{
		//alert(num)
		if (/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(mail)==true)
		{
			if (ID>0)
			{
				//RZ = agent.call('Action', 'CM', ID+String.fromCharCode(27)+num+String.fromCharCode(27)+comNum+String.fromCharCode(27)+name+String.fromCharCode(27)+text+String.fromCharCode(27)+city+String.fromCharCode(27)+mail);
				RZ = agent.call('', 'Action', '', 'CM', ID+String.fromCharCode(27)+num+String.fromCharCode(27)+comNum+String.fromCharCode(27)+name+String.fromCharCode(27)+text+String.fromCharCode(27)+city+String.fromCharCode(27)+mail);
				try{eval(RZ)} catch(e){}
			}
			else
			{
				//RZ = agent.call('Action', 'AS', num+String.fromCharCode(27)+comNum+String.fromCharCode(27)+name+String.fromCharCode(27)+text+String.fromCharCode(27)+city+String.fromCharCode(27)+mail);
				RZ = agent.call('', 'Action', '', 'AS', num+String.fromCharCode(27)+comNum+String.fromCharCode(27)+name+String.fromCharCode(27)+text+String.fromCharCode(27)+city+String.fromCharCode(27)+mail);
				try{eval(RZ)} catch(e){}
			}
		}
		else
			alert(SubsBad);
	}
	else
	alert(enterNum);

}

function res()
{

	//buildsubmenus()
}

var monthName = new Array ("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь");
var dayName = new Array ("Воскресение", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота");

function timer()
{
	objTimer = document.getElementById("timers")

	dateObj = new Date()
	day = dateObj.getDate()
	month = monthName[dateObj.getMonth()];
	year = dateObj.getFullYear()
	Dn = dayName[dateObj.getDay()]

	hour = dateObj.getHours()
	min = dateObj.getMinutes()
	sec = dateObj.getSeconds()

	if (hour<10) hour = '0'+hour
	if (min<10) min = '0'+min
	if (sec<10) sec = '0'+sec

	objTimer.innerHTML = Dn+', '+day+" "+month+" "+year+"<br>"+hour+":"+min+":"+sec


}


function Registred()/*Функция регистрационной формы в гос закупе*/
{
	inputFIO = document.getElementById('inputFIO'); //Фамилия, Имя, Отчество уполномоченного представителя потенциального поставщика
	inputNameLich = document.getElementById('inputNameLich');//Данные документа, удостоверяющего личность уполномоченного представителя потенциального поставщика
	inputNameDataY = document.getElementById('inputNameDataY');//Номер и дата доверенности на уполномоченного представителя потенциального поставщика
	inputNameOrg = document.getElementById('inputNameOrg');
	inputAdresOrg = document.getElementById('inputAdresOrg');
	inputMail = document.getElementById('inputMail');
	inputDopInfo = document.getElementById('inputDopInfo');
	inputLogin = document.getElementById('inputLogin');
	inputPassword = document.getElementById('inputPassword');
	inputPasswordRec = document.getElementById('inputPasswordRec');
	
	FIO = inputFIO.value;
	NameLich = inputNameLich.value;
	NameDataY = inputNameDataY.value;
	NameOrg = inputNameOrg.value;
	Adress = inputAdresOrg.value;
	Mail = inputMail.value;
	DopInfo = inputDopInfo.value;
	Login = inputLogin.value;
	Pas = inputPassword.value;
	PasRec = inputPasswordRec.value;

	if (Pas == PasRec)
	if (NameOrg != '')
	if (Mail != '')
	if (Login != '')
	{
		//RZ = agent.call('Action', 'Reg', NameOrg+String.fromCharCode(27)+Adress+String.fromCharCode(27)+Mail+String.fromCharCode(27)+Login+String.fromCharCode(27)+Pas+String.fromCharCode(27)+DopInfo);
		RZ = agent.call('', 'Action', '', 'Reg', NameOrg+String.fromCharCode(27)+Adress+String.fromCharCode(27)+Mail+String.fromCharCode(27)+Login+String.fromCharCode(27)+Pas+String.fromCharCode(27)+DopInfo);
		//alert(RZ)
		//Result = agent.call('','Reg','', NameOrg, Adress, Mail, Login, Pas, DopInfo);
		if (RZ == 0)
		{
			alert(loginNot)
			inputLogin.value = '';
			inputPasswordRec.value = '';
			inputPassword.value = '';
		}
		if (RZ == -1)
		{
			alert(notCorrect);
		}
		if (RZ == 1)
		{
			alert(regOk)
			inputFIO.value = '';
			inputNameOrg.value = '';
			inputAdresOrg.value = '';
			inputMail.value = '';
			inputDopInfo.value = '';
			inputLogin.value = '';
			inputPassword.value = '';
			inputPasswordRec.value = '';
		}
	}
	else
	alert(logNot)
	else
	alert(mailOrg)
	else
	alert(nmOrg)
	else
	alert(pasNot)

}

function destReg()
{
	if (document.getElementById('regform') != null)
	document.getElementById('regform').parentNode.removeChild(document.getElementById('regform'));
}

function regLoad(ID)
{
	Login = document.getElementById('inputLog').value
	Pas = document.getElementById('inputPas').value
	//RZ = agent.call('Action', 'SMU', ID+String.fromCharCode(27)+Login+String.fromCharCode(27)+Pas);
	RZ = agent.call('', 'Action', '', 'SMU', ID+String.fromCharCode(27)+Login+String.fromCharCode(27)+Pas);
	try{eval(RZ)} catch(e){}
}


function fileLoad(obj, ID)
{
	destReg()
	//RZ = agent.call('Action', 'SM', ID);
	RZ = agent.call('', 'Action', '', 'SM', ID);
	try{eval(RZ)} catch(e){}
}



function AddBookmark() {
	window.external.addFavorite ('http://www.esep.kz' , 'www.esep.kz')
}

function subscribe(email, lang)
{
	//RZ = agent.call('Action', 'SUBS', email+String.fromCharCode(27)+lang);
	RZ = agent.call('', 'Action', '', 'SUBS', email+String.fromCharCode(27)+lang);
	try{eval(RZ)} catch(e){}
}

function unsubscribe(email, lang)
{
	//RZ = agent.call('Action', 'UNSUBS', email);
	RZ = agent.call('', 'Action', '', 'UNSUBS', email+String.fromCharCode(27)+lang);
	try{eval(RZ)} catch(e){}
}

