function submitContactPlacesForm(block_code)
{
	var el = document.getElementById(block_code + '_form')
	
	if (validateContactPlacesForm(el, block_code))
	{
		el['smtd'].value = 'digidy78';
		el.submit();
	}
	
	return false;
}

function validateContactPlacesForm(el, block_code)
{
	var name = eval('el.' + block_code + '_zip');
	if(name.value == '')
	{
		alert('Doplňte směrovací číslo.');
		name.focus();
		return false
	}
	
	return true
}

function checkEnterContactPlacesForm(e, code)
{
	var activeElement;
	
	if (typeof(e.target) != 'undefined')
		activeElement = e.target;
	else if(typeof(e.srcElement) != 'undefined')
		activeElement = e.srcElement;
	
	if(e && e.keyCode == 13 && activeElement.type != 'textarea')
	{
		submitContactPlacesForm(code)
		return false
	}
	else
		return true
}
