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("Please, fill all required fields");
	return;
  }else if(submitaddboard() == '0'){
  	return document.addform.submit();
  }
 ;
}



var strboard1;
var strboard2;
var strtempboard;
function submitaddboardcomment()
{
	strtempboard = "0";
	strboard1 = "";
	strboard2 = "0";
	if ((document.addcommentboard.name.value.length < 3))
	{
		this.document.getElementById("showname").style.display='block';
		strboard2 = '1';
	}

	if ((document.addcommentboard.email.value.length < 6))
	{
		this.document.getElementById("showemail").style.display='block';
		strboard2 = '1';
	}

	if ((document.addcommentboard.four.value!=4))
	{
		this.document.getElementById("showfour").style.display='block';
		strboard2 = '1';
	}

	
	return strboard2;
}

function addcomment()
{
	this.document.getElementById("showname").style.display='none';
	this.document.getElementById("showemail").style.display='none';
	this.document.getElementById("showfour").style.display='none';

  if (submitaddboardcomment() == '1'){
	strboard1 = "";
	alert("Please, fill all required fields");
	return;
  }else if(submitaddboardcomment() == '0'){
  	return document.addcommentboard.submit();
  }
 ;
}

function submitformreason()
{
	strboard3 = "0";
	if ((document.request_reason.reason.value.length < 3))
	{
		this.document.getElementById("show_reason").style.display='block';
		strboard3 = '1';
	}
	return strboard3;
}

function formreason()
{
	this.document.getElementById("show_reason").style.display='none';

   if(submitformreason() == '1'){
	 strboard3 = "";
	  alert("You did not fill the field - «Cause».");
	   return;
   }
   else if(submitformreason() == '0'){
  	       return document.request_reason.submit();
   }
 ;
}








