var httpRequest = createHttpRequest();
var result = '';

function sendRequest(file, _result, getRequestProc) {
result = _result;
document.getElementById(result).innerHTML = 'Загрузка... <img src="/loading.gif">';
httpRequest.open('POST', file, true)
httpRequest.onreadystatechange = getRequest;
httpRequest.send(null);
}

function getRequest() {
if (httpRequest.readyState == 4) {
document.getElementById(result).innerHTML = httpRequest.responseText;
}}

function createHttpRequest()
{
    if (window.XMLHttpRequest) {
        try {
            return new XMLHttpRequest();
        } catch (e){}
    } else if (window.ActiveXObject) {
        try {
            return new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e){
          try {
              return new ActiveXObject('Microsoft.XMLHTTP');
          } catch (e){}
        }
    }
    return null;
}



function FuncProfile(x)
{
var dd="dd" + x;
var profile="profile" + x;
document.getElementById('profile1').style.display = 'none';
document.getElementById('profile2').style.display = 'none';
document.getElementById('profile3').style.display = 'none';
document.getElementById('profile4').style.display = 'none';
document.getElementById('profile5').style.display = 'none';
document.getElementById(profile).style.display = 'block';

document.getElementById('dd1').style.backgroundColor = '#FFE1FD';
document.getElementById('dd1').style.color = '#000000';
document.getElementById('dd2').style.backgroundColor = '#FFE1FD';
document.getElementById('dd2').style.color = '#000000';
document.getElementById('dd3').style.backgroundColor = '#FFE1FD';
document.getElementById('dd3').style.color = '#000000';
document.getElementById('dd4').style.backgroundColor = '#FFE1FD';
document.getElementById('dd4').style.color = '#000000';
document.getElementById('dd5').style.backgroundColor = '#FFE1FD';
document.getElementById('dd5').style.color = '#000000';

document.getElementById(dd).style.backgroundColor = '#8D59B8';
document.getElementById(dd).style.color = '#FFFFFF';

} 

function check1()
{
	var ErrorText = "";
	var Fields = new Array();
		Fields["login_org"]    = "Логин";
		Fields["password_org"]     = "Пароль";
		Fields["password2_org"]  = "Подтверждение пароля";
		Fields["email_org"]  = "E-mail";
		Fields["fio_org"]  = "ФИО";
		Fields["code_org"]  = "Код";
		Fields["check_org"]  = "Пользовательское соглашение";
		Fields["company_org"]  = "Название компании";
		Fields["adress_org"]  = "Адрес";
		Fields["sphera_org"]  = "Сфера деятельности";
		Fields["phone_org"]  = "Телефон";
		Fields["org_org"]  = "ORG";
       if (document.getElementById('dolzhnost_org').value=='') { document.getElementById('dolzhnost_org').value=" "; }

	var CheckReed=document.BackForm1.check_org.checked;
	var PasswordReed=document.BackForm1.password_org.value;
	var BackForm1 = document.getElementById("BackForm1");
	var Elements = BackForm1.elements;
       var PassLen = PasswordReed.length;
       for(var i=0; i < Elements.length; i++) {  if (Elements[i].value.length == 0) { if (i!="10") { ErrorText += Fields[Elements[i].name] + ", "; }}}
       var email = Elements["email_org"].value;
	if ((ErrorText.length > 0) || (CheckReed==false) || (!email.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) || (PassLen<6)) { 
	  sendRequest('/personal/ajax_registration.php?reg=org&login_org='+document.BackForm1.login_org.value+'&password_org='+document.BackForm1.password_org.value+'&password2_org='+document.BackForm1.password2_org.value+'&email_org='+document.BackForm1.email_org.value+'&fio_org='+document.BackForm1.fio_org.value+'&code_org='+document.BackForm1.code_org.value+'&company_org='+document.BackForm1.company_org.value+'&adress_org='+document.BackForm1.adress_org.value+'&sphera_org='+document.BackForm1.sphera_org.value+'&phone_org='+document.BackForm1.phone_org.value+'&check_org='+document.BackForm1.check_org.checked, 'result', getRequest); 
  	  return authFormWindow.ShowLoginForm();
	}  else {  BackForm1.submit();  }
}


function check2()
{
	var ErrorText = "";
	var Fields = new Array();
		Fields["login_fiz"]    = "Логин";
		Fields["password_fiz"]     = "Пароль";
		Fields["password2_fiz"]  = "Подтверждение пароля";
		Fields["email_fiz"]  = "E-mail";
		Fields["fio_fiz"]  = "ФИО";
		Fields["code_fiz"]  = "Код";
		Fields["check_fiz"]  = "Пользовательское соглашение";
		Fields["fiz_fiz"]  = "ФИЗ";

	var CheckReed=document.BackForm2.check_fiz.checked;
	var PasswordReed=document.BackForm2.password_fiz.value;
	var BackForm2 = document.getElementById("BackForm2");
	var Elements = BackForm2.elements;
       var PassLen = PasswordReed.length;
       for(var i=0; i < Elements.length; i++) { if(Elements[i].value.length == 0) { ErrorText += Fields[Elements[i].name] + ", "; }}
       var email = Elements["email_fiz"].value;
	if ((ErrorText.length > 0) || (CheckReed==false) || (!email.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) || (PassLen<6)) { 
	  sendRequest('/personal/ajax_registration.php?reg=fiz&login_fiz='+document.BackForm2.login_fiz.value+'&password_fiz='+document.BackForm2.password_fiz.value+'&password2_fiz='+document.BackForm2.password2_fiz.value+'&email_fiz='+document.BackForm2.email_fiz.value+'&fio_fiz='+document.BackForm2.fio_fiz.value+'&code_fiz='+document.BackForm2.code_fiz.value+'&check_fiz='+document.BackForm2.check_fiz.checked, 'result', getRequest); 
  	  return authFormWindow.ShowLoginForm();
	}  else {  BackForm2.submit();  }
}


function check3()
{
	var ErrorText = "";
	var Fields = new Array();
		Fields["fio"]    = "ФИО";
		Fields["email"]     = "Email";
		Fields["phone"]  = "Телефон";
		Fields["dolzhnost"]  = "Должность";

	var BackForm3 = document.getElementById("BackForm3");
	var Elements = BackForm3.elements;
       for(var i=0; i < 3; i++) { if(Elements[i].value.length == 0) { ErrorText += Fields[Elements[i].name] + ", "; }}
       var email = Elements["email"].value;
	if ((ErrorText.length > 0) || (!email.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/))) { 
	  sendRequest('/personal/ajax_employees.php?fio='+document.BackForm3.fio.value+'&email='+document.BackForm3.email.value+'&phone='+document.BackForm3.phone.value+'&dolzhnost='+document.BackForm3.dolzhnost.value, 'result', getRequest); 
  	  return authFormWindow.ShowLoginForm();
	}  else { BackForm3.submit();  }
}

function check4()
{
	var ErrorText = "";
	var Fields = new Array();
		Fields["fio"]    = "ФИО";
		Fields["email"]     = "Email";
		Fields["phone"]  = "Телефон";
		Fields["dolzhnost"]  = "Должность";

	var BackForm4 = document.getElementById("BackForm4");
	var Elements = BackForm4.elements;
       for(var i=0; i < 3; i++) { if(Elements[i].value.length == 0) { ErrorText += Fields[Elements[i].name] + ", "; }}
       var email = Elements["email"].value;
	if ((ErrorText.length > 0) || (!email.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/))) { 
	  sendRequest('/personal/ajax_employees.php?fio='+document.BackForm4.fio.value+'&email='+document.BackForm4.email.value+'&phone='+document.BackForm4.phone.value+'&dolzhnost='+document.BackForm4.dolzhnost.value, 'result', getRequest); 
  	  return authFormWindow.ShowLoginForm();
	}  else { BackForm4.submit();  }
}



function CheckLetter()
{
    var name_reed = document.getElementById('name');
    var info_reed = document.getElementById('info');
       var pic_file = document.getElementById('pic').value;
	var picrush;
	var reg=/.jpg|.gif|.png|.rar|.zip|pdf|doc/i;
	var result=reg.test(pic_file) ? picrush=1 : picrush=2
    if ((pic_file!='') && (picrush!='1')) {  document.getElementById('pic').value=''; alert ('Формат файла должен быть .jpg .png .gif  .rar  .zip  pdf или doc');  }

    var btn = document.getElementById('btn');
    if ((name_reed.value != '')  && (info_reed.value!= '') ) { btn.disabled = false; } else { btn.disabled = true; }
}


function EmployeesEdit(x) 
{ 
	var EmployeesEdit='EmployeesEdit_'+x;
	document.getElementById(EmployeesEdit).submit(); 
}


function EmployeesDelete(x, y)
{
 var EmployeesDelete='EmployeesDelete_'+x;
 if (confirm("Удалить сотрудника: "+y+"?")) window.location.replace('/personal/employees.php?DW='+x);
}

function VacancyEdit(x) 
{ 
	var VacancyEdit='VacancyEdit_'+x;
	document.getElementById(VacancyEdit).submit(); 
}


function VacancyDelete(x, y)
{
 var EmployeesDelete='EmployeesDelete_'+x;
 if (confirm("Удалить вакансию: "+y+"?")) window.location.replace('/personal/vacancy.php?DW='+x);
}

function vacancy()
{
	var ErrorText = "";
	var Fields = new Array();
		Fields["sphera"]    = "Сфера деятельности";
		Fields["rubrica"]     = "Рубрики";
		Fields["leayer"]  = "Уровень должности";
		Fields["city"]  = "Город";
		Fields["graphic"]  = "График работы";
		Fields["face"]  = "Контактное лицо";
		Fields["dolzhnost"]  = "Название должности";
		Fields["paysumm"]  = "Зарплата";
		Fields["pay1"]  = "Зарплата";
	var Vacancy = document.getElementById("Vacancy");
	var Elements = Vacancy.elements;
       if ((document.Vacancy.sphera.value=='') || (document.Vacancy.rubrica.value=='') || (document.Vacancy.leayer.value=='') || (document.Vacancy.city.value=='') || (document.Vacancy.graphic.value=='') || (document.Vacancy.face.value=='') || (document.Vacancy.dolzhnost.value=='')) { 
	  sendRequest('/personal/ajax_vacancy.php?sphera='+document.Vacancy.sphera.value+'&paysumm='+document.Vacancy.paysumm.value+'&pay1='+document.getElementById('pay2').checked+'&rubrica='+document.Vacancy.rubrica.value+'&leayer='+document.Vacancy.leayer.value+'&city='+document.Vacancy.city.value+'&graphic='+document.Vacancy.graphic.value+'&face='+document.Vacancy.face.value+'&dolzhnost='+document.Vacancy.dolzhnost.value, 'result', getRequest); 
  	  return authFormWindow.ShowLoginForm();
	}  else { Vacancy.submit();  }
}

function RezumeEdit(x) 
{ 
	var RezumeEdit='RezumeEdit_'+x;
	document.getElementById(RezumeEdit).submit(); 
}


function RezumeDelete(x, y)
{
 var RezumeDelete='RezumeDelete_'+x;
 if (confirm("Удалить резюме: "+y+"?")) window.location.replace('/personal/rezume.php?DW='+x);
}

function rezume()
{
	var ErrorText = "";
	var Fields = new Array();
		Fields["fio"]    = "ФИО";
		Fields["sex"]     = "Пол";
		Fields["city"]  = "Город";
		Fields["proffessional"]  = "Профессиональная область";
		Fields["obrazovanie"]  = "Образование";
		Fields["birthday"]  = "Дата Рождения";
	var Rezume = document.getElementById("Rezume");
	var Elements = Rezume.elements;
       if ((document.Rezume.fio.value=='') || (document.Rezume.sex.value=='') || (document.Rezume.city.value=='') || (document.Rezume.proffessional.value=='') || (document.Rezume.obrazovanie.value=='') || (document.Rezume.birthday.value=='')) { 
	  sendRequest('/personal/ajax_rezume.php?fio='+document.Rezume.fio.value+'&sex='+document.Rezume.sex.value+'&city='+document.Rezume.city.value+'&proffessional='+document.Rezume.proffessional.value+'&obrazovanie='+document.Rezume.obrazovanie.value+'&birthday='+document.Rezume.birthday.value, 'result', getRequest); 
  	  return authFormWindow.ShowLoginForm();
	}  else { Rezume.submit();  }
}




function checkPhoto(x) 
{
var picture='pic_' + x;
var pic_file = document.getElementById(picture).value;
var picrush;
    var reg=/.jpg|.gif|.png/i;
    var result=reg.test(pic_file) ? picrush=1 : picrush=2
    if ((pic_file!='') && (picrush!='1')) {  document.getElementById(picture).value='';  var picerror=1;  alert ('Формат файла должен быть .jpg .gif  или  png');  } else { AddItem(x); }
}

var itemsW=1;
function AddItem() { 
  div=document.getElementById("items");
  button=document.getElementById("addname");  itemsW++; 
  newitem="<span id=\"a" + itemsW + "\"><div class=\"photo1\"><div class=\"photo2\"><a href=\"javascript:void(null)\" onclick=\"deleteAddItem('a" + itemsW + "')\"><img src=\"/images/delete_poerty_order.gif\"></a></div><div class=\"photo3\">" + itemsW + "</div><div class=\"photo4\">Файл: <input type=\"file\" name=\"file[]\" id=\"pic_" + itemsW + "\" value=\"\" onchange=\"checkPhoto(" + itemsW + ");\"><br/><br/>Описание:<br/><textarea  name=\"message[]\" value=\"\" class=\"photo5\"></textarea></div></div></span>";
  newnode=document.createElement("span");
  newnode.innerHTML=newitem;
  div.insertBefore(newnode, button);
} 
function deleteAddItem(x){  r=document.getElementById(x); r.parentNode.removeChild(r);  itemsW=itemsW; }


function BoardDelete(x, y)
{
 var RezumeDelete='RezumeDelete_'+x;
 if (confirm("Удалить объявление: "+y+"?")) window.location.replace('/personal/board.php?DW='+x);
}


function SmsDelete(x, y)
{
 var RezumeDelete='RezumeDelete_'+x;
 if (confirm("Удалить объявление?")) window.location.replace('/personal/sms.php?DW='+x);
}


function Board()
{
var ErrorText = "";
var Fields = new Array();
	Fields["tip"]  = "Тип";
	Fields["object"]    = "Рубрика";
	Fields["subject"]        = "Заголовок";
	Fields["price"]      = "Цена";
	Fields["valuta"]      = "Валюта";
	Fields["dogovor"]   = "цена договорная";
	Fields["message"]      = "Текст объявления";
	Fields["face"]      = "Контактное лицо";
	Fields["phone"]      = "Телефон";
	Fields["email"]      = "E-mail";
	Fields["look"]     = "показывать на сайте";
	Fields["icq"]      = "ICQ";
	var BackForm = document.getElementById("Board");
      if ((document.Board.subject.value=='')  || (document.Board.phone.value=='') || (document.Board.price.value=='') || (!document.Board.email.value.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) || (document.Board.price.value=='0') || (document.Board.message.value=='') || (document.Board.face.value=='') || (document.Board.email.value=='')) { 
	 if ((document.Board.price.value=='') || (document.Board.price.value=='0')) { alert('Не заполнено поле: Цена.'); var error='y'; } 
	 if ((document.Board.message.value=='') && (error!='y')) { alert('Не заполнено поле: Текст объявления.'); var error='y'; } 
	 if ((document.Board.face.value=='') && (error!='y')) { alert('Не заполнено поле: Контактное лицо.'); var error='y'; }
	 if ((document.Board.phone.value=='') && (error!='y')) { alert('Не заполнено поле: Телефон.'); var error='y'; }
	 if ((document.Board.email.value=='') && (error!='y')) { alert('Не заполнено поле: E-mail.'); var error='y'; }
	 if ((!document.Board.email.value.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) && (error!='y')) { alert('Неправильно введен E-mail.'); var error='y'; }
       } else {  BackForm.submit();  } 
}


function Waistcoat(x)
{
var ErrorText = "";
var Fields = new Array();
	Fields["tip"]  = "Тип";
	Fields["object"]    = "Объект";
	Fields["rooms"]        = "Количество комнат";
	Fields["full_area"]    = "Общая площадь";
	Fields["living_area"]      = "Жилая площадь";
	Fields["floor"]      = "Этаж";
	Fields["floorall"]      = "Этажей";
	Fields["location"]      = "Расположение";
	Fields["region"]      = "Район";
	Fields["street"]      = "Улица";
	Fields["number"]      = "Номер дома";
	Fields["price"]      = "Цена";
	Fields["valuta"]      = "Валюта";
	Fields["dogovor"]   = "цена договорная";
	Fields["message"]      = "Текст объявления";
	Fields["face"]      = "Контактное лицо";
	Fields["phone"]      = "Телефон";
	Fields["email"]      = "E-mail";
	Fields["look"]     = "показывать на сайте";
	Fields["icq"]      = "ICQ";
	var BackForm = document.getElementById("Waistcoat");
      if ((document.Waistcoat.price.value=='') || (document.Waistcoat.phone.value=='') || (!document.Waistcoat.email.value.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) || (document.Waistcoat.full_area.value=='0.0') || (document.Waistcoat.price.value=='0') || (document.Waistcoat.message.value=='') || (document.Waistcoat.face.value=='') || (document.Waistcoat.email.value=='')) { 
	 if ((document.Waistcoat.price.value=='') || (document.Waistcoat.price.value=='0')) { alert('Не заполнено поле: Цена.'); var error='y'; } 
	 if (((document.Waistcoat.full_area.value=='') || (document.Waistcoat.full_area.value=='0.0'))  && (error!='y')) { alert('Не заполнено поле: Площадь.'); var error='y'; } 
	 if ((document.Waistcoat.message.value=='') && (error!='y')) { alert('Не заполнено поле: Текст объявления.'); var error='y'; } 
	 if ((document.Waistcoat.face.value=='') && (error!='y')) { alert('Не заполнено поле: Контактное лицо.'); var error='y'; }
	 if ((document.Waistcoat.phone.value=='') && (error!='y')) { alert('Не заполнено поле: Телефон.'); var error='y'; }
	 if ((document.Waistcoat.email.value=='') && (error!='y')) { alert('Не заполнено поле: E-mail.'); var error='y'; }
	 if ((!document.Waistcoat.email.value.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) && (error!='y')) { alert('Неправильно введен E-mail.'); var error='y'; }
       } else {  
		if ((x==406) || (x==407)) { 
		   if ((document.Waistcoat.street.value=='') && (error!='y')) { alert('Не заполнено поле: Улица.'); var error='y'; }
	 	   if ((document.Waistcoat.number.value=='') && (error!='y')) { alert('Не заполнено поле: Номер дома.'); var error='y'; }
		} 
if (error!='y') {  BackForm.submit();  }
}}


function Commercial()
{
var ErrorText = "";
var Fields = new Array();
	Fields["tip"]  = "Тип";
	Fields["object"]    = "Объект";
	Fields["rooms"]        = "Количество комнат";
	Fields["full_area"]    = "Общая площадь";
	Fields["living_area"]      = "Жилая площадь";
	Fields["floor"]      = "Этаж";
	Fields["floorall"]      = "Этажей";
	Fields["location"]      = "Расположение";
	Fields["region"]      = "Район";
	Fields["street"]      = "Улица";
	Fields["number"]      = "Номер дома";
	Fields["price"]      = "Цена";
	Fields["valuta"]      = "Валюта";
	Fields["dogovor"]   = "цена договорная";
	Fields["message"]      = "Текст объявления";
	Fields["face"]      = "Контактное лицо";
	Fields["phone"]      = "Телефон";
	Fields["email"]      = "E-mail";
	Fields["look"]     = "показывать на сайте";
	Fields["icq"]      = "ICQ";
	var BackForm = document.getElementById("Waistcoat");
      if ((document.Waistcoat.price.value=='') || (document.Waistcoat.street.value=='')  || (document.Waistcoat.phone.value=='') || (!document.Waistcoat.email.value.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) || (document.Waistcoat.full_area.value=='0.0') || (document.Waistcoat.price.value=='0') || (document.Waistcoat.message.value=='') || (document.Waistcoat.face.value=='') || (document.Waistcoat.email.value=='')) { 
	 if ((document.Waistcoat.price.value=='') || (document.Waistcoat.price.value=='0')) { alert('Не заполнено поле: Цена.'); var error='y'; } 
	 if (((document.Waistcoat.full_area.value=='') || (document.Waistcoat.full_area.value=='0.0'))  && (error!='y')) { alert('Не заполнено поле: Площадь.'); var error='y'; } 
	 if ((document.Waistcoat.message.value=='') && (error!='y')) { alert('Не заполнено поле: Текст объявления.'); var error='y'; } 
	 if ((document.Waistcoat.face.value=='') && (error!='y')) { alert('Не заполнено поле: Контактное лицо.'); var error='y'; }
	 if ((document.Waistcoat.phone.value=='') && (error!='y')) { alert('Не заполнено поле: Телефон.'); var error='y'; }
	 if ((document.Waistcoat.street.value=='') && (error!='y')) { alert('Не заполнено поле: Улица.'); var error='y'; }
	 if ((document.Waistcoat.email.value=='') && (error!='y')) { alert('Не заполнено поле: E-mail.'); var error='y'; }
	 if ((!document.Waistcoat.email.value.match(/^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$/)) && (error!='y')) { alert('Неправильно введен E-mail.'); var error='y'; }
       } else { BackForm.submit();  }
}




function WaistcoatDelete(x, y)
{
 var RezumeDelete='RezumeDelete_'+x;
 if (confirm("Удалить объявление: "+y+"?")) window.location.replace('/personal/waistcoat.php?DW='+x);
}

function CommercialDelete(x, y)
{
 var RezumeDelete='RezumeDelete_'+x;
 if (confirm("Удалить объявление: "+y+"?")) window.location.replace('/personal/commercial.php?DW='+x);
}


function objects(x)
{
if (x==406) { 
	document.getElementById('roomsMyBlock').style.display='block'; 
	document.getElementById('living_areaMyBlock').style.display='block'; 
	document.getElementById('floorMyBlock').style.display='block'; 
	document.getElementById('full_areaMy').innerHTML='Общая площадь';  
	document.getElementById('MyStreetS').style.display='block'; 
	document.getElementById('MyNomersS').style.display='block'; 
	document.getElementById('living_areaMy').innerHTML='Жилая площадь'; 
}
if (x==407) { 
	document.getElementById('roomsMyBlock').style.display='block'; 
	document.getElementById('living_areaMyBlock').style.display='block'; 
	document.getElementById('floorMyBlock').style.display='block'; 
	document.getElementById('full_areaMy').innerHTML='Площадь квартиры';  
	document.getElementById('MyStreetS').style.display='block'; 
	document.getElementById('MyNomersS').style.display='block'; 
	document.getElementById('living_areaMy').innerHTML='Площадь комнаты'; 
}
if (x==408) { 
	document.getElementById('roomsMyBlock').style.display='block'; 
	document.getElementById('living_areaMyBlock').style.display='block'; 
	document.getElementById('floorMyBlock').style.display='none'; 
	document.getElementById('MyStreetS').style.display='none'; 
	document.getElementById('MyNomersS').style.display='none'; 
	document.getElementById('full_areaMy').innerHTML='Площадь участка';  
	document.getElementById('living_areaMy').innerHTML='Площадь дома'; 
}
if (x==409) { 
	document.getElementById('roomsMyBlock').style.display='none'; 
	document.getElementById('living_areaMyBlock').style.display='none'; 
	document.getElementById('floorMyBlock').style.display='none'; 
	document.getElementById('MyStreetS').style.display='none'; 
	document.getElementById('MyNomersS').style.display='none'; 
	document.getElementById('full_areaMy').innerHTML='Площадь участка';  
}
if (x==410) { 
	document.getElementById('roomsMyBlock').style.display='none'; 
	document.getElementById('living_areaMyBlock').style.display='none'; 
	document.getElementById('floorMyBlock').style.display='none'; 
	document.getElementById('MyStreetS').style.display='none'; 
	document.getElementById('MyNomersS').style.display='none'; 
	document.getElementById('full_areaMy').innerHTML='Площадь гаража';   
}}


function objectsComm(x)
{
if (x==401) { document.getElementById('floorMyBlock').style.display='block'; document.getElementById('living_areaMy').innerHTML='Отдельный вход'; }
if (x==402) { document.getElementById('floorMyBlock').style.display='block'; document.getElementById('living_areaMy').innerHTML='Отдельный вход'; }
if (x==403) { document.getElementById('floorMyBlock').style.display='none';  document.getElementById('living_areaMy').innerHTML='Подъездные пути'; }
if (x==405) { document.getElementById('floorMyBlock').style.display='none';  document.getElementById('living_areaMy').innerHTML='Подъездные пути'; }
if (x==404) { document.getElementById('floorMyBlock').style.display='none'; document.getElementById('living_areaMy').innerHTML='Подъездные пути';  }
}

function objectTypes(x)
{
if (x==406) { document.getElementById('rooms').style.display='block'; document.getElementById('AreasMy').style.display='block';  document.forms.frm.action="/db/apartment/";  }
if (x==407) { document.getElementById('rooms').style.display='block'; document.getElementById('AreasMy').style.display='block';    document.forms.frm.action="/db/rooms/"; }
if (x==408) { document.getElementById('rooms').style.display='block';  document.getElementById('AreasMy').style.display='block';   document.forms.frm.action="/db/Houses-Cottages-Lands/"; }
if (x==409) { document.getElementById('rooms').style.display='none';  document.getElementById('AreasMy').style.display='none';   document.forms.frm.action="/db/area/"; }
if (x==410) { document.getElementById('rooms').style.display='none'; document.getElementById('AreasMy').style.display='none';  document.forms.frm.action="/db/Garage/";  }
}



function checkinput(obj) {
    if(isNaN(obj.value)) {
        alert('Значение этого поля должно быть числовым !');
        obj.value = '0';
        obj.focus();
    }
} 


function addSoc(a) {
h=encodeURIComponent(window.location.href+window.location.hash);
t=encodeURIComponent(document.title);
if(a==1)h='twitter.com/timeline/home?status='+t+'%20'+h;
else if(a==2)h='www.facebook.com/share.php?u='+h;
else if(a==3)h='vkontakte.ru/share.php?url='+h+'&title='+t;
else if(a==4)h='odnoklassniki.ru/dk?st.cmd=addShare&st.s=1000&st._surl='+h+'&tkn=3009';
else if(a==5)h='www.livejournal.com/update.bml?mode=full&subject='+t+'&event='+h;
else if(a==6)h='wow.ya.ru/posts_share_link.xml?url='+h+'&title='+t;
else if(a==7)h='connect.mail.ru/share?url='+h+'&title='+t+'&description=&imageurl=';
else return;
window.open('http://'+h,'Soc','screenX=100,screenY=100,height=500,width=900,location=no,toolbar=no,directories=no,menubar=no,status=no');
}

