var str1;
var str2;
var strtemp;
function submitaddboard()
{
	strtemp = "0";
	str1 = "";
	str2 = "0";
	if ((document.addform.region.value>0)){
		if ((document.addform.city.value==0)){
			this.document.getElementById("showcity").style.display='block';
			str2 = '1';
		}
	}else{
			this.document.getElementById("showcity").style.display='block';
			str2 = '1';
	}
	
	if ((document.addform.category.value>0)){
		if ((document.addform.categoryid.value==0)){
			this.document.getElementById("showcategory").style.display='block';
			str2 = '1';
		}
	}else{
			this.document.getElementById("showcategory").style.display='block';
			str2 = '1';
	}
	
	
	if ((document.addform.title.value.length < 10))
	{
		this.document.getElementById("showtitle").style.display='block';
		str2 = '1';
	}

	if ((document.addform.name.value.length < 3))
	{
		this.document.getElementById("showname").style.display='block';
		str2 = '1';
	}

	if ((document.addform.email.value.length < 6))
	{
		this.document.getElementById("showemail").style.display='block';
		str2 = '1';
	}

	
	return str2;
}


function goaddboard()
{
	this.document.getElementById("showcity").style.display='none';
	this.document.getElementById("showcategory").style.display='none';
	this.document.getElementById("showtitle").style.display='none';
	this.document.getElementById("showname").style.display='none';
	this.document.getElementById("showemail").style.display='none';

  if (submitaddboard() == '1'){
	str1 = "";
	alert("Пожалуйста, заполните все обязательные поля.");
	return;
  }else if(submitaddboard() == '0'){
  	return document.addform.submit();
  }
 ;
}


