<!-- <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> -->
function sale_init(broi) {
 for (var i=1; i<=broi; i++) {
 	var obj=document.getElementById('pp'+i);
	obj.className = 'normal';
 }
}

function show_send(id, id2) {
  if(document.getElementById(id).className == "show") {
  	document.getElementById(id).className = "hide";
  	document.getElementById(id2).className = "show";
  } else {
  	document.getElementById(id2).className = "hide";
  	document.getElementById(id).className = "show";
  }
}

function sale_alarm(id_) {
 	var obj=document.getElementById(id_);
	obj.className = 'red';
}

function sale_check(form_id, broi, lang) {
	
 sale_init(broi);
 
 var problem='';
 var obj2=document.getElementById(form_id);
 
 if ((obj2.property_type!=undefined)  && (obj2.location!=undefined) && (obj2.city!=undefined) && (obj2.condition!=undefined))
 	{
	var prop_type = obj2.property_type.selectedIndex;
	var pr_type = obj2.property_type.options[prop_type].text;
	
	var locate = obj2.location.selectedIndex;
	var loc = obj2.location.options[locate].text;

	var grad = obj2.city.selectedIndex;
	var cit = obj2.city.options[grad].text;

	var condit = obj2.condition.selectedIndex;
	var con = obj2.condition.options[condit].text;
	}
	if (obj2.pr_type!=undefined) { obj2.pr_type.value = pr_type; }
	if (obj2.loc!=undefined) { obj2.loc.value = loc; }
	if (obj2.cit!=undefined) { obj2.cit.value = cit; }
	if (obj2.con!=undefined) { obj2.con.value = con; }
 
 for (var i=1; i<=broi; i++) {
 	var obj=document.getElementById('p'+i);
	if (obj.value == '') {
		sale_alarm('pp'+i);
		problem = '1';
	}
 }
 
 var prob = "";

 if (lang) 	
 	{ 
		if (lang=='bg')
			{
				prob="Моля, попълнете всички полета, маркирани с *";
			}
		if (lang=='ru')
			{
				prob="Поля с * - обязателны!";
			}	
	}
  else 
			{
				prob="Please, fill in all required fields, marked with *";
			}
	
 if(problem != '')  {
	alert(prob); 
 } else {
 	obj2.submit(); 
 }
}

